Hi, I have been developing my website over the last weeks using XOOPS and I am starting to get to grips with the different modules, themes, templates and blocks.
However, I have a problem and have been unable to find a solution.
I have the mydownloads module installed 5 times. I cloned the original and now have a myvideos, myprograms, mysounds, mygames and a myjokes module for my website. I also have the myalbum module installed for pictures.
Each of these has subcategories and I have over 3000 different files uploaded across these sections. Everything is functioning extremely well and I am pleased with the results.
However, here is what I want to do :
Have a block that details how many files I have in each of these modules so that I can display to my visitors :
Videos : 600 files
Programs : 185 files
Jokes : 215 files
Pictures : 1200
Sounds : 235
Games : 325
Any ideas on how I can do this? Is there a module or block out there that is easy to re-apply.
My php skills are not too good, but I have played around with a php script that returns a value in the Smarty Debug Screen for each of these values but I have no idea how to incorporate this into XOOPS where I would like it to go (tried a php Custom Block with no luck). Here is the code (fogive me if it is c**p) I used to return these values when my php page was loaded :
list($numvids)=$xoopsDB->fetchRow($xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mydownloads_downloads")." WHERE status>0"));
$xoopsTpl->assign('totalvids', $numvids);
list($numprogs)=$xoopsDB->fetchRow($xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("myprograms_downloads")." WHERE status>0"));
$xoopsTpl->assign('totalprogs', $numprogs);
list($numgames)=$xoopsDB->fetchRow($xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mygames_downloads")." WHERE status>0"));
$xoopsTpl->assign('totalgames', $numgames);
list($numsounds)=$xoopsDB->fetchRow($xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mysounds_downloads")." WHERE status>0"));
$xoopsTpl->assign('totalsounds', $numsounds);
list($numjokes)=$xoopsDB->fetchRow($xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("myjokes_downloads")." WHERE status>0"));
$xoopsTpl->assign('totaljokes', $numjokes);
list($numpics)=$xoopsDB->fetchRow($xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("myalbum_photos")." WHERE status>0"));
$xoopsTpl->assign('totalpics', $numpics);
Thanks in advance for any help!!