Login to Your Account


Login using your Facebook account

Join the Mercury Community

Click on all the boats to prove you're human.


Recent Thread Activity

Suggestions
3 Posts - 329 d 22 h 47 min
Event module ideas / suggestions
1 Posts - 405 d 43 min
content too long on CMS pages
2 Posts - 799 d 3 h 26 min
CMS file name - needs error checking
2 Posts - 799 d 3 h 26 min
auto category image
2 Posts - 864 d 7 h 45 min
Group Forums Error on first post
1 Posts - 871 d 12 h 9 min
start new post - needs error checking
2 Posts - 878 d 10 h 34 min
Suggestions
3 Posts - 926 d 7 h 23 min
internal messaging needs editor
5 Posts - 926 d 7 h 31 min
Approve Friend Error
2 Posts - 926 d 7 h 35 min
problem with link
1 Posts - 935 d 1 h 50 min
Comments
2 Posts - 963 d 5 h 12 min
CAPTCHA updates
3 Posts - 982 d 12 h 50 min
Forums : Custom Modules Thread: Custom Module Setup started July 19, 2009, 5:46 am (Not Following)

todd
MESSAGE
JUL 19 2009 5:07 AM

I have been building the code for a Garage section that will contain Rides under the Profile view.  So Garage will be like Groups and a Ride will be like an individual Group.

 

Currently I have two top level folders for them /garage and /rides at the \v_drive\var\www\sites\friendsthatride.com\html\mercury level.

 

Do I need to define these as modules any where to get them to be seen?

 

I have a garage.php file that is not being found in this location...

\v_drive\var\www\sites\friendsthatride.com\html\mercury\profiles\garage.php

 

although, if I copy it to this location it works...

\v_drive\var\www\mercury\profiles\garage.php

 

Well kind of works, it does not wrap the file with the FTR site.  And I know we don't want to change or add anything to the top mercury folders. 

 

I found the CoreModules table in the friendsthatride DB and added 'garage' & 'rides' to it, although that did not help any.  Is this something that has to recycle the web server to take effect?  Or what steps am I missing to get this functional?  If you need more information just let me know. This has only been done on my VM Dev stuff so far.

 

Thanks,

Todd


dan
MESSAGE
JUL 19 2009 5:07 AM


Modules that are stored within a site's Mercury folder are there for one of two reasons.  1) they are custom modules or 2) they contain display or functional overrides.  Any code that is in there can be called via the processes you are using.  Anything that is called from a hook however needs one more step.  The admin is built using hooks and I wanted a way to let a site developer choose which links to show up top (or which modules to enable).  Since core modules are stored centrally and available to all I needed a way to mark these.

In your html/mercury/MODULE folders you may have noticed files called ".enabled".  This marks a module as being able to be called via a hook.  Then when you set up your hook file make sure that the name of the file in your hook folder matches the name of your custom module.   Your code should now function.

otherwise, remember that Linux is case sensitive.  If you are calling a module called garage you could use /garage as your link and it would seek an index.php file in /html/mercury/garage.   You can obviously call other files in that folder by calling /garage/other-page and it will seek other-page.php in that same folder.

You won't need to mess with the CoreTables table.  That is only there for updating the core Mercury system and tracking versioning.

In case all of the above doesn't shed any light on your situation I have one more request.  You are sharing the physical paths where you are putting the files but not the URLs you are using to call them.  Please share some of that and I'll see what I can do.


todd
MESSAGE
JUL 19 2009 6:07 AM

I did have .enabled in the garage folder and just added it to the rides folder.  Still no go.  The link is first called from the ftr/html/mercury/profiles/display/layout.php

            <A <?php if(end($path) == "garage") echo "id=profilesNavOn" ?> HREF="/profiles/<?= $user['Username'] ?>/garage">Garage</A>
 

The browser goes to ftr/profiles/taburton/garage and displays this error...

An error occured in script '/mnt/hgfs/www/mercury/profiles/router.php' on line 33:
require(garage.php) [function.require]: failed to open stream: No such file or directory
Date/Time: 7-19-2009 13:08:29

Array
(
    [GLOBALS] => Array
 *RECURSION*
    [_POST] => Array
        (
        )

    [_GET] => Array
        (
            [path] => profiles/taburton/garage

        )

    [_COOKIE] => Array
        (
            [_csuid] => 4a1a31b405451991
            [PHPSESSID] => o0hehb4194kek9enbfc1nm3075

{There is more to the error if you need let me know.}

If I copy the garage.php file to the core mercury area /profiles/garage.php it does not give the error.  It displays the profile header content and no site wrapped around it.

   

 

 


dan
MESSAGE
JUL 19 2009 7:07 AM

okay, this makes more sense.  you're not actually running that file as a standalone module, you're building it subsidiary to profiles.  check out how the images one works.  there is a file called images (or image) in the profiles folder but then it called functions and leverages display files out of the /image module.

So either extend profiles by calling functionality from another module (like images) or just add new functionality to your per-site profiles module.  Either is fine.


dan
MESSAGE
JUL 19 2009 7:07 AM

also, there are only two ways you won't get a layout wrapper around your content. One is because you have explicitly specified a different layout using m("core", "setLayout", "filename.php"); or m("core", "setLayout", "filename.php");.  The only other way is if your code has an error.  PHP isn't very good about actually displaying error messages and instead favors a white screen.


todd
MESSAGE
JUL 19 2009 7:07 AM
    [m] => Array
        (
            [path] => profiles/taburton/garage/
        )

    [mercurykeyvalue] => path
    [contact_email] => dan@chickinteractive.com
    [local] => 
    [dbc] => 
    [debug] => 
    [javascript] => Array
        (
        )

    [css] => Array
        (
        )

    [title] => 
    [meta-description] => 
    [meta-keywords] => 
    [layout] => layout.php
    [includepath] => /var/www/mercury/profiles/router.php
    [actualpath] => profiles/taburton/garage/
    [isadmin] => 
    [path] => Array
        (
            [0] => profiles
            [1] => taburton
            [2] => garage
            [3] => 
        )

    [module] => profiles
    [action] => no-action.php
    [possiblepaths] => Array
        (
            [0] => /var/www/sites/friendsthatride.com/html/profiles/taburton/garage/
            [1] => /var/www/sites/friendsthatride.com/html/profiles/taburton/garage/index.php
            [2] => /var/www/sites/friendsthatride.com/html/profiles/taburton/garage/index.html
            [3] => /var/www/sites/friendsthatride.com/html/mercury/profiles/router.php
            [4] => /var/www/mercury/profiles/router.php
            [5] => /var/www/sites/friendsthatride.com/html/mercury/profiles/taburton.php
            [6] => /var/www/mercury/profiles/taburton.php
        )

    [specificpath] => /var/www/mercury/profiles/router.php
    [count] => 0
)

todd
MESSAGE
JUL 19 2009 7:07 AM

Here is the rest of that error message.  Hopefully it helps

 


dan
MESSAGE
JUL 19 2009 7:07 AM

nope, the first few lines convey most of the real info.  did my suggestions yield nothing?


todd
MESSAGE
JUL 19 2009 8:07 AM

Yeah, still stuck on the same point.  Link added in /profiles/display/layout.php should point to /profiles/layout/garage.php and only works when garage.php is placed at  ...var\www\mercury\profiles\garage.php

I even made a copy of groups.php in the ftr/profiles/display/ location named garage.php and it still errors out.


dan
MESSAGE
JUL 19 2009 12:07 PM

what code are you using to do the actual include?


dan
MESSAGE
JUL 25 2009 4:07 PM

i went through all of this with pete so hopefully that sheds some light.  I also plan to assemble a document that provides a crash course.  I'll post a blog entry on here when that happens.