Modules : Fix for xdirectory and alumni search needing mid

Posted by john on 2005/2/25 14:50:00 (3854 reads)
I figured out how to not have to add the mid manually for xdirectory, and alumni modules. Always back up your site before making any changes.

Xdirectory,
In the file xdirectory/index.php

look for this line

$xoopsTpl->assign('lang_url', _MD_SITEURL);

after it add this line

$xoopsTpl->assign('xmid', $xoopsModule->getVar('mid'));

Then in the file xdirectory/templates/xdir_index.html replace the actual number of the module with <{$xmid}> so it looks like below.

value='<{$xmid}>' />

then update module and your done.
_________________________________________________

Alumni Module

Just a little different, go to alumni/index.php look for function index() add this line

$xoopsTpl->assign('xmid', $xoopsModule->getVar('mid'));

before this line

$xoopsTpl->assign('add_from', _ALUM_ADDFROM." ".$xoopsConfig['sitename']);

go to alumni/templates/alumni_index.html

replace the actual number of the module with <{$xmid}> so it looks like below.

value='<{$xmid}>' />

now with this module you need to add $xoopsModule, to the global like below

global $xoopsDB, $xoopsConfig, $xoopsModule, $xoopsUser, $xoopsTpl, $moderated, $myts, $mytree, $souscat, $classm, $nbsouscat, $meta, $newann, $mid;

Update the module, Thats it, This works for me, Hope you find it useful.

John
Printer Friendly Page Send this Story to a Friend Create a PDF from the article
The comments are owned by the author. We aren't responsible for their content.
Author Thread
Login
Username:

Password:

Remember me



Lost Password?

Register now!
 
Main Menu
 
Who's Online
7 user(s) are online (1 user(s) are browsing News)

Members: 0
Guests: 7

more...
 
Donat-O-Meter
Make donations with PayPal!
Stats
Goal: $25.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $25.00