| Re: man whats wrong with my oninstall function.? |
| by iHackCode on 2006/10/27 15:17:31 Quote:
Thanks Mith.. it was the i in onInstall i didn't notice that its supposed to be capitalized.. Quote: PS: Your capitalisation of each word is enormously disrupting for the readability Its A Bad Habit..
|
| Re: man whats wrong with my oninstall function.? |
| by Mithrandir on 2006/10/27 14:58:13 any PHP errors about failing to open a file? Note that the file specified in $modversion is relative to the module's root folder, so the file oninstall.php should reside in /modules/xmspotlight/ Also note that the array index is case sensitive, so try changing it to $modversion['onInstall'] = "oninstall.php"; (capital I in onInstall) PS: Your capitalisation of each word is enormously disrupting for the readability
|
| Re: man whats wrong with my oninstall function.? |
| by iHackCode on 2006/10/27 14:54:48 Quote:
- I dont Think its being called. - I Noticed The Changes Are Not Made - And There Are No Errors And Also.. Queries Didnt Have Any Entries For Alter Table. (when i install the module) Module Is XM-Spotlight (Directory 'xmspotlight'). Im Trying To Make An oninstall function but... im not successful. |
| Re: man whats wrong with my oninstall function.? |
| by Mithrandir on 2006/10/27 14:42:15 Is the function not called correctly? Or doesn't it perform the changes? What does PHP/MySQL debug say? |
| [Solved!]man whats wrong with my oninstall function.? |
| by iHackCode on 2006/10/27 14:39:08 man im getting a headache trying to figure out why this doesnt work. xoops_version... $modversion['oninstall'] = "oninstall.php"; file is oninstall.php le="color: #000000"><?php function xoops_module_install_xmspotlight(&$module){ global $xoopsDB; //add field in stories table for link to img for article or spotlight. if (!FieldExists('imgspotlight',$xoopsDB->prefix('stories'))) { $result = $xoopsDB->query("ALTER TABLE ".$xoopsDB->prefix('stories'). " ADD imgspotlight varchar(255) NOT NULL default ' ' "); //add some messages? } //add field in stories table for text for img credits if (!FieldExists('imgspotlightdesc',$xoopsDB->prefix('stories'))) { $result = $xoopsDB->query("ALTER TABLE ".$xoopsDB->prefix('stories')." ADD imgauthor varchar(255) NOT NULL default ' ' "); //add some messages? } } function FieldExists($fieldname,$table) { global $xoopsDB; $result=$xoopsDB->queryF("SHOW COLUMNS FROM $table LIKE '$fieldname'"); return($xoopsDB->getRowsNum($result) > 0); } spent like an hour trying to figure out whats wrong.. any help would be great.. |