1
codefantom
How do I find the module id?
  • 2013/6/27 22:28

  • codefantom

  • Just popping in

  • Posts: 19

  • Since: 2013/6/19


I just found the faq on how to create a from to search an individual module but it says that I need the module id. How do I go about finding this? Is it based on the order of the modules in the module admin section? Or is there a way to visual see it?

2
oswaldo
Re: How do I find the module id?
  • 2013/6/28 0:35

  • oswaldo

  • Quite a regular

  • Posts: 215

  • Since: 2008/8/22


look at the database

3
codefantom
Re: How do I find the module id?
  • 2013/6/28 1:02

  • codefantom

  • Just popping in

  • Posts: 19

  • Since: 2013/6/19


I checked the database but none of my modules are assigned id's. I have a total of 7 modules installed, 2 are deactivated. (I also have 2 modules that im not including because they are bad installs that won't delete from the admin area) but in any case only one active module has a "mid." The rest are blank. Is there a way to fix this? Is it safe to assign them "mid's" from phpadmin? or do I need to do a fresh install of xoops?

4
codefantom
Re: How do I find the module id?
  • 2013/6/28 2:24

  • codefantom

  • Just popping in

  • Posts: 19

  • Since: 2013/6/19


Here is a screenshot of my db.
Any help is appreciated.

Resized Image

5
zyspec
Re: How do I find the module id?
  • 2013/6/28 3:14

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


How you retrieve the module ID (mid) for a module depends on which PHP script you are trying to find it in. For many instances you can just use:

$mid $GLOBALS['xoopsModule']->mid();


Or if you're trying to find a specific module's mid when your in a PHP script for blocks you could do something like:

$module_handler =& xoops_gethandler('module');
$config_handler =& xoops_gethandler('config');
$myMod $module_handler->getByDirName('yourModuleFolderNameHere');
$mid $myMod->mid();

6
codefantom
Re: How do I find the module id?
  • 2013/6/28 4:48

  • codefantom

  • Just popping in

  • Posts: 19

  • Since: 2013/6/19


This below code is the script I'm trying to use. I put it in a block and it displays fine. But I can't get any search results to come up. When I use the advanced search with the same keyword I get search results fine. Which means this script is not pointing to the right module. I have systematically used 3-9 as my module id but none of them work. which can't be right.

Any more suggestions? This is one of my last two issues and I can publish the site.



<form action="<{$xoops_url}>/search.php" method="post" style="margin-bottom: 0px; margin-top: 0px;">
<
input class="srchinput" name="query" size="15" type="text" /> 
<
input name="action" type="hidden" value="results" /> 
<
input name="mids[]" type="hidden" value="5" /> 
<
input align="middle" name="Submit" src="<{$xoops_imageurl}>srchbut.gif" type="image" value="Search" />
form>

7
oswaldo
Re: How do I find the module id?
  • 2013/6/29 14:44

  • oswaldo

  • Quite a regular

  • Posts: 215

  • Since: 2008/8/22


Look at your database in the first colum (mid) means Module ID

8
Tarik
Re: How do I find the module id?
  • 2013/6/29 15:06

  • Tarik

  • Not too shy to talk

  • Posts: 170

  • Since: 2010/2/3 1


Quote:

$mid $GLOBALS['xoopsModule']->mid();

arent GLOBALS deprecated o.O?

and btw it seems like you have a problem in your modules (the ones with the mids 8 and 9) no name and folder is set

Login

Who's Online

364 user(s) are online (223 user(s) are browsing Support Forums)


Members: 0


Guests: 364


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits