admin/module.php not showing new modules installed

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   re: admin/module.php not showing new modules installed
dkwds
CZ Active Member
dkwds has been a member for over 20 year's 20 Year Member
uk.gif
Occupation: Student
Age: 38
Gender: Male
Website:
Status: Offline
Joined: Jul 29, 2004
0.04 posts per day
Posts: 282
Points: 12,713
   
Doing this didn't work for me. i still can't see them in the admin panel. icon_sad.gif



Back to top Reply with quote
#2   re: admin/module.php not showing new modules installed
64bitguy
CZ Super Newbie
64bitguy has been a member for over 20 year's 20 Year Member
usa.gif newhampshire.gif
Occupation: IT Guru, IT Portal Operator
Website:
Status: Offline
Joined: Sep 04, 2004
0.00 posts per day
Posts: 34
Points: 2,699
   
Umm... Not to rain on anyone's parade or anything, but modules for 7.3 don't go into the root/admin/modules folder! They go into root/modules/ folder!

The only things that go in root/admin/modules folders are PHP-Nuke admin functions, not modules.

Move your modules over to the root/modules folder and they will THEN appear in your admin/modules screen, so you can enable them for your different classes of users.

Steph [ Register or login to view links on this board. ]
The IT Portal for IT People!
[ Register or login to view links on this board.]



Back to top Reply with quote
#3   re: admin/module.php not showing new modules installed
dkwds
CZ Active Member
dkwds has been a member for over 20 year's 20 Year Member
uk.gif
Occupation: Student
Age: 38
Gender: Male
Website:
Status: Offline
Joined: Jul 29, 2004
0.04 posts per day
Posts: 282
Points: 12,713
   
Well aware of that m8 icon_razz.gif
It just that the modules even though they are present in the modules folder don't show up in the modules section in admin and therefore cannot be activated for usage. icon_sad.gif



Back to top Reply with quote
#4   re: admin/module.php not showing new modules installed
64bitguy
CZ Super Newbie
64bitguy has been a member for over 20 year's 20 Year Member
usa.gif newhampshire.gif
Occupation: IT Guru, IT Portal Operator
Website:
Status: Offline
Joined: Sep 04, 2004
0.00 posts per day
Posts: 34
Points: 2,699
   
Cool! Glad it wasn't that....

I just kept reading the message with:



I have added to the root/admin/module folder.


Over and over and was really hoping that's not what you meant!

icon_smile.gif

Steph [ Register or login to view links on this board. ]
The IT Portal for IT People!
[ Register or login to view links on this board.]



Back to top Reply with quote
#5   re: admin/module.php not showing new modules installed
dkwds
CZ Active Member
dkwds has been a member for over 20 year's 20 Year Member
uk.gif
Occupation: Student
Age: 38
Gender: Male
Website:
Status: Offline
Joined: Jul 29, 2004
0.04 posts per day
Posts: 282
Points: 12,713
   
I got it sorted out. Created new rows to display them in phpMyAdmin. Not perfect but does the job.



Back to top Reply with quote
#6   re: admin/module.php not showing new modules installed
Dawg
CZ Newbie
Dawg has been a member for over 20 year's 20 Year Member
canada.gif
Age: 51
Gender: Male
Status: Offline
Joined: Sep 29, 2004
0.00 posts per day
Posts: 2
Points: 636
   
Ok I have read through this post and the few others like it on the list and I still don't see what is going on.

Though reading through I have noticed that my root/admin/modules/modules.php file does not contain the same line that Telli has said to Change.

Mine reads as follow

if ($mid == "") {
                $db->sql_query("insert into ".$prefix."_modules values (NULL, '$modlist[$i]', '".str_replace("_", " ", $modlist[$i])."', '0', '0', '1', '0', '1', '')");
            }


And my nuke_modules table has the following info:

mid  int(10)    auto_increment             
   title  varchar(255)       
   custom_title  varchar(255)             
   active  int(1)               
   view  int(1)             
   groups  text
   inmenu  tinyint(1)               
   mod_group  int(10)                 
   mcid  int(11)             
   url  varchar(255)   


Now it looks like I have a few extra fields but that could be because I am running NSN-Groups.

Please help as I would like to have this work without having to add rows manually everytime.



_________________
Dawg

Frequent lock ups are a symptom of not enough memory but only in the way that nosebleeds are a symptom of gunshot wounds to the head.
Back to top Reply with quote
#7   re: admin/module.php not showing new modules installed
DAMIAN
CZ Active Member
 Codezwiz Site Donator
DAMIAN has been a member for over 20 year's 20 Year Member
usa.gif mississippi.gif
Occupation: Net Junkie
Age: 58
Gender: Male
Fav. Sports Team: steelers
Website:
Status: Offline
Joined: Aug 08, 2004
0.02 posts per day
Posts: 177
Points: 9,848
   
Same problem here with 7.5 and the above doesnt seem to fix it, ive got several modules im trying to include but none show up in the admin panel. They show up in the modules folder, tried changing chmod just do not show up in the actual admin panel.



Back to top Reply with quote
#8   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
Is this a modified module control panel or the standard one with nuke?




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#9   re: admin/module.php not showing new modules installed
DAMIAN
CZ Active Member
 Codezwiz Site Donator
DAMIAN has been a member for over 20 year's 20 Year Member
usa.gif mississippi.gif
Occupation: Net Junkie
Age: 58
Gender: Male
Fav. Sports Team: steelers
Website:
Status: Offline
Joined: Aug 08, 2004
0.02 posts per day
Posts: 177
Points: 9,848
   
its standard, just loaded entire site up last weekend, only thing modified is edl and enhanced downloads.



Back to top Reply with quote
#10   re: admin/module.php not showing new modules installed
Tommyguns
CZ Newbie
Tommyguns has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Oct 11, 2004
0.00 posts per day
Posts: 6
Points: 1,228
   
I am now having the same problem -- any help would be appreciated.

Here is my copy of the admin>modules>modules.php

<?php
/********************************************************/
/* CZModules V4                                         */
/* By: Telli (telli@codezwiz.com)                       */
/* http://www.codezwiz.com                              */
/* Copyright © 2002-2004 by Codezwiz.com                */
/********************************************************/

if (!eregi("admin.php", $_SERVER['SCRIPT_NAME'])) { die ("Access Denied"); }

$result = $db->sql_query("select radminsuper from ".$prefix."_authors where aid='$aid'");
list($radminsuper) = $db->sql_fetchrow($result);
if ($radminsuper==1) {

/*********************************************************/
/* Modules Block Functions                               */
/*********************************************************/

function czm_get_lang($module) {
    global $currentlang, $language;
    if ($module == admin) {
      if (file_exists("admin/language/CZModules/lang-$currentlang.php")) {
         include_once("admin/language/CZModules/lang-$currentlang.php");
      } else {
         include_once("admin/language/CZModules/lang-english.php");
      }
    }
}
czm_get_lang(admin);

function mainmenu(){
    global  $bgcolor1, $bgcolor2, $textcolor1;
    OpenTable();
    echo "<center>\n<table width='60%' cellpadding='2' cellspacing='1' bgcolor='$textcolor1'>\n";
    echo "<tr bgcolor='$bgcolor2'><td align='center' colspan='2' class='option'><b>"._MAINMENU."</b></td></tr>\n";
    echo "<tr bgcolor='$bgcolor2' align='center'>\n";
    echo "<td width='50%'><a href='admin.php?op=categories'>"._ADMINMODCATS."</a></td>\n";
    echo "<td width='50%'><a href='admin.php?op=modules'>"._ADMINMODMODULES."</a></td>\n";
    echo "<tr bgcolor='$bgcolor2' align='center'>\n";
    echo "<td width='50%'><a href='admin.php?op=modules_config'>"._CONFIGUREMODULEOPTIONS."</a></td>\n";
    echo "<td width='50%'><a href='admin.php?op=modules_exlinks'>"._EXLINKS."</a></td>\n";
    echo "</tr>\n</table><br />[ <a href='admin.php'>"._BACKTOMAINADMIN."</a> ]\n</center>\n";
    CloseTable();
}

function CZModulecopy(){
echo "<br>";
OpenTable();
echo "<div align=\"right\">CZModules Block Tweak by <a href=\"http://codezwiz.com/\">Telli</a></div>";
echo "<div align=\"right\">Copyright &copy; 2002-2004 by Codezwiz</div>";
CloseTable();
}

switch ($op){

   case "categories":
    global  $db, $prefix, $bgcolor2, $textcolor1;
    $mcid = intval($mcid);
    include("header.php");
    title(_MODULESADMIN);
    mainmenu();
    /* Move Category */
    $result = $db->sql_query("SELECT * FROM ".$prefix."_modules_categories");
    $numrows = $db->sql_numrows($result);
    if($numrows>0){
        OpenTable();
        echo "<font class='content'><b>"._ORDERCATEGORY."</b></font><br><br>";
        $result2 = $db->sql_query("SELECT mcid, mcname, mcposition FROM ".$prefix."_modules_categories ORDER BY mcposition");
        echo "<center><table width='60%' border='1'><tr><td width='5%' bgcolor='$bgcolor2'>"._MODCATPOSITION."</td>";
        echo "<td width='20%' bgcolor='$bgcolor2' align='center'>"._MODCATNAME."</td>";
        echo "<td width='10%' colspan='2' bgcolor='$bgcolor2' align='center'>"._MODCATMOVE."</td></tr>";
        while(list($mcid, $mcname, $mcposition) = $db->sql_fetchrow($result2)){
            $mcposup = $mcposition-1;
            $mcposdown = $mcposition+1;
            echo "<tr><td width='5%'>$mcposition</td><td width='20%'>$mcname</td>";
            if($mcposition != 1){
                echo "<td width='5%' align='center'><a href='admin.php?op=modules_category_up&mcid=$mcid&mcposup=$mcposup'>"._MODCATMOVEUP."</a></td>";
            } else {
                echo "<td width='5%' align='center'>&nbsp;</td>";
            }
            echo "<td width='5%' align='center'><a href='admin.php?&op=modules_category_down&mcid=$mcid&mcposdown=$mcposdown'>"._MODCATMOVEDOWN."</a></td></tr>";
        }
        echo "</table></center>";
        CloseTable();
       }

    /* Add A New Modules Category */
    echo "<br>";
    OpenTable();
    echo "<form method='post' action='admin.php'>";
    echo "<font class='content'><b>"._ADDMAINCATEGORY."</b><br><br>";
    echo ""._NAME.": <input type='text' name='mcname' size='30' maxlength='100'><br>";
    echo "<input type='hidden' name='op' value='modules_add_category'>";
    echo "<input type='submit' value='"._ADD."'><br>";
    echo "</form>";
    CloseTable();

    /* Modify Category */
    $result = $db->sql_query("select * from ".$prefix."_modules_categories");
    $numrows = $db->sql_numrows($result);
    if ($numrows>0) {
        echo "<br>";
        OpenTable();
        echo "<form method='post' action='admin.php'>";
        echo "<font class='content'><b>"._MODCATEGORY."</b></font><br><br>";
        $result2=$db->sql_query("select mcid, mcname from ".$prefix."_modules_categories order by mcname");
        echo ""._CATEGORY.": <select name='cat'>";
        while(list($mcid2, $mcname2) = $db->sql_fetchrow($result2)) { echo "<option value='$mcid2'>$mcname2</option>"; }
        echo "</select>";
        echo "<input type='hidden' name='op' value='modules_edit_category'>";
        echo "&nbsp;&nbsp;<input type='submit' value='"._MODIFY."'>";
        echo "</form>";
        CloseTable();
    }
    CZModulecopy();
    include("footer.php");
    break;


    case "modules":
    global  $prefix, $db, $bgcolor2;
    $mcid = intval($mcid);
    include ("header.php");
    title(_MODULESADMIN);
    mainmenu();
    $handle=opendir('modules');
    while ($file = readdir($handle)) { if ( (!ereg("[.]",$file)) ) { $modlist .= "$file "; } }
    closedir($handle);
    $modlist = explode(" ", $modlist);
    sort($modlist);
    for ($i=0; $i < sizeof($modlist); $i++) {
        if($modlist[$i] != "") {
            $result = $db->sql_query("select mid from ".$prefix."_modules where title='$modlist[$i]'");
            list ($mid) = $db->sql_fetchrow($result);
            if ($mid == "") {
                $db->sql_query("insert into ".$prefix."_modules values (NULL, '$modlist[$i]', '".str_replace("_", " ", $modlist[$i])."', '0', '0', '1', '0', '1', '', '')");
            }
        }
    }
    $result = $db->sql_query("select title from ".$prefix."_modules");
    while (list($mtitle) = $db->sql_fetchrow($result)) {
        $a = 0;
        $handle=opendir('modules');
        while ($file = readdir($handle)) { if ($file == $mtitle) { $a = 1; } }
        closedir($handle);
        if ($a == 0)
        {
         $db->sql_query("delete from ".$prefix."_modules where title='$mtitle'");
         $db->sql_query("optimize table ".$prefix."_modules"); 
        }
      }

    $theader .= "<table border='1' align='center' width='99%'><tr><td align='center' bgcolor='$bgcolor2' width='15%'>";
    $theader .= "<b>"._TITLE."</b></td><td align='center' bgcolor='$bgcolor2' width='15%'><b>"._CUSTOMTITLE."</b></td><td align='center' bgcolor='$bgcolor2' width='10%'><b>"._STATUS."</b></td><td align='center' bgcolor='$bgcolor2' width='20%'><b>"._VIEW."</b></td><td align='center' bgcolor='$bgcolor2' width='10%'><b>"._GROUP."</b></td><td align='center' bgcolor='$bgcolor2' width='25%'><b>"._FUNCTIONS."</b></td></tr></table><br />";
    OpenTable();
    $main_m = $db->sql_fetchrow($db->sql_query("SELECT main_module from ".$prefix."_main"));
    $main_module = $main_m['main_module'];
    echo "<form action='admin.php' method='post'>";
    echo "<center><font class='option'>"._MODULESADDONS."</font><br><br>";
    echo "<font class='content'>"._MODULESACTIVATION."</font><br><br>";
    echo ""._MODULEHOMENOTE."<br><br>"._NOTINMENU."<br><br>$theader";
    $mcid_sections = "";
    $i = 1;
    $sql = "SELECT mcid, mcname, mcposition FROM ".$prefix."_modules_categories WHERE visible='1' ORDER BY mcposition";
    $result1 = $db->sql_query($sql);
    while ($row = $db->sql_fetchrow($result1)) {
    $mcidp = intval($row['mcid']);
    $mcnamep = $row['mcname'];
    $mcid_sections .= "<table border='1' align='center' width='99%'><tr><td align='center' bgcolor='$bgcolor2'><font class='title'><b>$mcnamep</b></font></td></tr></table>";
    $mcid_sections .= "<table border='0' align='center' width='100%'><tr><td>";
    $result = $db->sql_query("select mid, title, custom_title, active, view, inmenu, mod_group, mcid from ".$prefix."_modules WHERE active='1' AND inmenu='1' AND mcid='$mcidp' order by custom_title ASC");
    while(list($mid, $mtitle, $custom_title, $active, $view, $inmenu, $mod_group, $mcid) = $db->sql_fetchrow($result)) {
            $mid = intval($mid);
         $active = intval($active);
         $view = intval($view);
         $inmenu = intval($inmenu);
         $mod_group = intval($mod_group);
            $mcid = intval($mcid);
        if ($custom_title == "") {
            $custom_title = ereg_replace("_"," ",$mtitle);
            $mid = intval($mid);
            $db->sql_query("update ".$prefix."_modules set custom_title='$custom_title' where mid='$mid'");
        }
        if ($active == 1) {
            $active = "<i>"._ACTIVE."</i>";
            $change = _DEACTIVATE;
            $act = 0;
        } else {
            $active = "<i>"._INACTIVE."</i>";
            $change = _ACTIVATE;
            $act = 1;
        }
        if ($custom_title == "") { $custom_title = ereg_replace("_", " ", $mtitle); }
        if ($view == 0) {
            $who_view = _MVALL;
        } elseif ($view == 1) {
            $who_view = _MVUSERS;
        } elseif ($view == 2) {
            $who_view = _MVADMIN;
        } elseif ($view == 3) {
       $who_view = _SUBUSERS;
   }


        if ($mtitle != $main_module AND $inmenu == 0) { $mtitle = "[ <big><strong>·;</strong></big> ] $mtitle"; }
        if ($mtitle == $main_module) {
            $mtitle = "<b>$mtitle</b>";
            $custom_title = "<b>$custom_title</b>";
            $active = "<b>("._INHOME.")</b>";
            $who_view = "<b>$who_view</b>";
            $puthome = "<i>"._PUTINHOME."</i>";
            $change_status = "<i>$change</i>";
        } else {
            $puthome = "<a href='admin.php?op=home_module&mid=$mid'>"._PUTINHOME."</a>";
            $change_status = "<a href='admin.php?op=module_status&mid=$mid&active=$act'>$change</a>";
        }
        if ($mod_group != 0) {
       $grp = $db->sql_fetchrow($db->sql_query("SELECT name FROM ".$prefix."_groups WHERE id='$mod_group'"));
       $mod_group = $grp['name'];
   } else {
       $mod_group = _NONE;
   }
       $mcid_sections .= "<table border='1' align='center' width='100%'><tr><td width='15%'>&nbsp;$mtitle</td><td align='center' width='15%'>$custom_title</td><td align='center' width='10%'>$active</td><td align='center' width='20%'>$who_view</td><td align='center' width='10%'>$mod_group</td><td align='center' width='25%'>[ <a href='admin.php?op=module_edit&mid=$mid'>"._EDIT."</a> | $change_status | $puthome ]</td>";   
       $mcid_sections .= "</tr></table>";
   }
            $mcid_sections .= "</td></tr></table><br />";
}
$i++;
           echo "$mcid_sections";

    $mcid_sections2 = "";
    $a = 1;
    $mcid_sections2 .= "<table border='1' align='center' width='99%'><tr>";
    $mcid_sections2 .= "<td align='center' bgcolor='$bgcolor2'><font class='title'><b>"._INVISIBLEMODULES."</b></font></td></tr></table>";
    $mcid_sections2 .= "<table border='0' align='center' width='100%'><tr><td>";
    $result = $db->sql_query("select mid, title, custom_title, active, view, inmenu, mod_group,  mcid from ".$prefix."_modules WHERE active='1' AND inmenu='0' ORDER by custom_title ASC");
    while(list($mid, $mtitle, $custom_title, $active, $view, $inmenu, $mod_group, $mcid) = $db->sql_fetchrow($result)) {
            $mid = intval($mid);
         $active = intval($active);
         $view = intval($view);
         $inmenu = intval($inmenu);
         $mod_group = intval($mod_group);
            $mcid = intval($mcid);        
        if ($custom_title == "") {
            $custom_title = ereg_replace("_"," ",$mtitle);
            $mid = intval($mid);
            $db->sql_query("update ".$prefix."_modules set custom_title='$custom_title' where mid='$mid'");
        }
        if ($active == 1) {
            $active = "<i>"._ACTIVE."</i>";
            $change = _DEACTIVATE;
            $act = 0;
        } else {
            $active = "<i>"._INACTIVE."</i>";
            $change = _ACTIVATE;
            $act = 1;
        }
        if ($custom_title == "") { $custom_title = ereg_replace("_", " ", $mtitle); }
        if ($view == 0) {
            $who_view = _MVALL;
        } elseif ($view == 1) {
            $who_view = _MVUSERS;
        } elseif ($view == 2) {
            $who_view = _MVADMIN;
        } elseif ($view == 3) {
       $who_view = _SUBUSERS;
   }

            if ($mtitle != $main_module AND $inmenu == 0) { $mtitle = "[ <big><strong>·;</strong></big> ] $mtitle"; }
        if ($mtitle == $main_module) {
            $mtitle = "<b>$mtitle</b>";
            $custom_title = "<b>$custom_title</b>";
            $active = "<b>("._INHOME.")</b>";
            $who_view = "<b>$who_view</b>";
            $puthome = "<i>"._PUTINHOME."</i>";
            $change_status = "<i>$change</i>";
        } else {
            $puthome = "<a href='admin.php?op=home_module&mid=$mid'>"._PUTINHOME."</a>";
            $change_status = "<a href='admin.php?op=module_status&mid=$mid&active=$act'>$change</a>";
        }
   if ($mod_group != 0) {
       $grp = $db->sql_fetchrow($db->sql_query("SELECT name FROM ".$prefix."_groups WHERE id='$mod_group'"));
       $mod_group = $grp['name'];
   } else {
       $mod_group = _NONE;
   }
       $mcid_sections2 .= "<table border='1' align='center' width='100%'><tr><td width='15%'>&nbsp;$mtitle</td><td align='center' width='15%'>$custom_title</td><td align='center' width='10%'>$active</td><td align='center' width='20%'>$who_view</td><td align='center' width='10%'>$mod_group</td><td align='center' width='25%'>[ <a href='admin.php?op=module_edit&mid=$mid'>"._EDIT."</a> | $change_status | $puthome ]</td>";   
       $mcid_sections2 .= "</tr></table>";

   }
$a++;
        $mcid_sections2 .= "</td></tr></table><br />";

     
      echo "$mcid_sections2";

       $mcid_sections3 = "";
    $a = 1;
    $mcid_sections3 .= "<table border='1' align='center' width='99%'><tr>";
    $mcid_sections3 .= "<td align='center' bgcolor='$bgcolor2'><font class='title'><b>"._INACTIVEMODULES."</b></font></td></tr></table>";
    $mcid_sections3 .= "<table border='0' align='center' width='100%'><tr><td>";
$result = $db->sql_query("select mid, title, custom_title, active, view, inmenu, mod_group, mcid from ".$prefix."_modules WHERE active='0' ORDER by custom_title ASC");
    while(list($mid, $mtitle, $custom_title, $active, $view, $inmenu, $mod_group, $mcid) = $db->sql_fetchrow($result)) {
            $mid = intval($mid);
         $active = intval($active);
         $view = intval($view);
         $inmenu = intval($inmenu);
         $mod_group = intval($mod_group);
            $mcid = intval($mcid);
        if ($custom_title == "") {
            $custom_title = ereg_replace("_"," ",$mtitle);
            $mid = intval($mid);
            $db->sql_query("update ".$prefix."_modules set custom_title='$custom_title' where mid='$mid'");
        }
        if ($active == 1) {
            $active = "<i>"._ACTIVE."</i>";
            $change = _DEACTIVATE;
            $act = 0;
        } else {
            $active = "<i>"._INACTIVE."</i>";
            $change = _ACTIVATE;
            $act = 1;
        }
        if ($custom_title == "") { $custom_title = ereg_replace("_", " ", $mtitle); }
        if ($view == 0) {
            $who_view = _MVALL;
        } elseif ($view == 1) {
            $who_view = _MVUSERS;
        } elseif ($view == 2) {
            $who_view = _MVADMIN;
        } elseif ($view == 3) {
       $who_view = _SUBUSERS;
   }

        if ($mtitle != $main_module AND $inmenu == 0) { $mtitle = "[ <big><strong>·;</strong></big> ] $mtitle"; }
        if ($mtitle == $main_module) {
            $mtitle = "<b>$mtitle</b>";
            $custom_title = "<b>$custom_title</b>";
            $active = "<b>("._INHOME.")</b>";
            $who_view = "<b>$who_view</b>";
            $puthome = "<i>"._PUTINHOME."</i>";
            $change_status = "<i>$change</i>";
        } else {
            $puthome = "<a href='admin.php?op=home_module&mid=$mid'>"._PUTINHOME."</a>";
            $change_status = "<a href='admin.php?op=module_status&mid=$mid&active=$act'>$change</a>";
        }
   if ($mod_group != 0) {
       $grp = $db->sql_fetchrow($db->sql_query("SELECT name FROM ".$prefix."_groups WHERE id='$mod_group'"));
       $mod_group = $grp['name'];
   } else {
       $mod_group = _NONE;
   }
              $mcid_sections3 .= "<table border='1' align='center' width='100%'><tr><td width='15%'>&nbsp;$mtitle</td><td align='center' width='15%'>$custom_title</td><td align='center' width='10%'>$active</td><td align='center' width='20%'>$who_view</td><td align='center' width='10%'>$mod_group</td><td align='center' width='25%'>[ <a href='admin.php?op=module_edit&mid=$mid'>"._EDIT."</a> | $change_status | $puthome ]</td>";   
              $mcid_sections3 .= "</tr></table>";

   }
$a++;
        $mcid_sections3 .= "</td></tr></table><br />";

     
      echo "$mcid_sections3";

    CloseTable();
    CZModulecopy();
    include ("footer.php");
    break; 

    case "home_module":
    global  $prefix, $db;
    $mid = intval($mid);
    $view = intval($view);
    $active = intval($active);
    if ($ok == 0) {
        include ("header.php");
        title(_HOMECONFIG);
        mainmenu();
        OpenTable();
        $result = $db->sql_query("select title from ".$prefix."_modules where mid='$mid'");
        list($new_m) = $db->sql_fetchrow($result);

        echo "<center><b>"._DEFHOMEMODULE."</b><br><br>";
        echo ""._SURETOCHANGEMOD." <b>".$main_module."</b> "._TO." <b>$new_m</b>?<br><br>";
        echo "[ <a href='admin.php?op=modules'>"._NO."</a> | <a href='admin.php?op=home_module&mid=$mid&ok=1'>"._YES."</a> ]</center>";
        CloseTable();
        CZModulecopy();
        include("footer.php");
       
    } else {
        $result = $db->sql_query("select title from ".$prefix."_modules where mid='$mid'");
        list($mtitle) = $db->sql_fetchrow($result);
        $active = 1;
        $view = 0;
        $result = $db->sql_query("update ".$prefix."_main set main_module='$mtitle'");
        $result = $db->sql_query("update ".$prefix."_modules set active='$active', view='$view' where title='$mtitle'");
        Header("Location: admin.php?op=modules");
    }
      break;

    case "module_status":
    global  $prefix, $db;
    $mid = intval($mid);
    $active = intval($active);
    $db->sql_query("update ".$prefix."_modules set active='$active' where mid='$mid'");
    Header("Location: admin.php?op=modules");
    break;

    case "module_edit":
    global  $prefix, $db, $bgcolor1, $bgcolor2;
    $mid = intval($mid);
    $result = $db->sql_query("select * from ".$prefix."_modules where mid='$mid'");
    $mid_info = $db->sql_fetchrow($result);
    include ("header.php");
    title(_MODULEEDIT);
    mainmenu();
    OpenTable();
    if ($mid_info['view'] == 0) {
        $sel1 = "selected";
        $sel2 = "";
        $sel3 = "";
        $sel4 = "";
    } elseif ($mid_info['view'] == 1) {
        $sel1 = "";
        $sel2 = "selected";
        $sel3 = "";
        $sel4 = "";
    } elseif ($mid_info['view'] == 2) {
        $sel1 = "";
        $sel2 = "";
        $sel3 = "selected";
        $sel4 = "";
    } elseif ($mid_info['view'] == 3) {
        $sel1 = "";
        $sel2 = "";
        $sel3 = "";
        $sel4 = "selected";
     }
    if ($mid_info['title'] == $main_module) { $a = " - "._INHOME.""; } else { $a = ""; }
    if ($mid_info['inmenu'] == 1) {
        $insel1 = "selected";
        $insel2 = "";
    } elseif ($mid_info['inmenu'] == 0) {
        $insel1 = "";
        $insel2 = "selected";
    }
    $mod_group = intval($mid_info['mod_group']);
    echo "<table align='center' border='0' cellpadding='2' cellspacing='2'>";
    echo "<tr><td align='center' colspan='2' class='option'><b>"._CHANGEMODNAME."</b><br>(".$mid_info['title']."$a)</td></tr>";
    echo "<form action='admin.php' method='get'>";
    echo "<tr><td bgcolor='$bgcolor2'>"._CUSTOMMODNAME."</td><td>";
    echo "<input type='text' name='custom_title' value='".$mid_info['custom_title']."' size='50'></td></tr>";
    if ($mid_info['title'] == $main_module) {
        echo "<input type='hidden' name='inmenu' value='0'>";
        echo "<input type='hidden' name='view' value='0'>";
    } else {
        echo "<tr><td bgcolor='$bgcolor2'>"._SHOWINMENU."</td><td><select name='inmenu'>";
        echo "<option value='1' $insel1> "._YES."</option><option value='0' $insel2> "._NO."</option>";
        echo "</select></td></tr>";
    echo "<tr><td bgcolor='$bgcolor2'>Preferred URL for GoogleTap:<br />(<i>Leave blank if you don't use Google Tap</i>)</td><td>"
        ."<input type=\"text\" name=\"url\" value=\"".$mid_info['url']."\" size=\"50\"></td></tr>";
        $result=$db->sql_query("select mcid, mcname from ".$prefix."_modules_categories order by mcid ASC");
        list($mcid, $mcname) = $db->sql_fetchrow($result);
        echo "<tr><td bgcolor='$bgcolor2'>"._CATEGORY.":</td><td><select name='mcat'>";
        $result2=$db->sql_query("select mcid, mcname from ".$prefix."_modules_categories order by mcid ASC");
        while(list($mcid2, $mcname2) = $db->sql_fetchrow($result2)) {
            $sql3 = "SELECT mcid FROM " .$prefix. "_modules WHERE mid='$mid'";
            $result3 = $db->sql_query($sql3);
            $row3 = $db->sql_fetchrow($result3);
            if ($mcid2==$row3[mcid]) {
                echo "<option value='$mcid2' selected>$mcname2</option>";
            } else {
                echo "<option value='$mcid2'>$mcname2</option>";
            }
        }
        echo "</select></td></tr>";
        echo "<tr><td bgcolor='$bgcolor2'>"._VIEWPRIV."</td><td><select name='view'>";
        echo "<option value='0' $sel1>"._MVALL."</option>";
        echo "<option value='1' $sel2>"._MVUSERS."</option>";
        echo "<option value='2' $sel3>"._MVADMIN."</option>";
        echo "<option value='3' $sel4>"._SUBUSERS."</option>";
        echo "</select></tr></td>";
   $numrow = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_groups"));
   if ($numrow > 0) {
       echo "<tr><td>" . _UGROUP . "</td><td><select name=\"mod_group\">";
        $result2 = $db->sql_query("SELECT id, name FROM " . $prefix . "_groups");
        while ($row2 = $db->sql_fetchrow($result2)) {
      if ($row2[id] == $mod_group) { $gsel = "selected"; } else { $gsel = ""; }
      if ($dummy != 1) {
          if ($mod_group == 0) { $ggsel = "selected"; } else { $ggsel = ""; }
          echo "<option value=\"0\" $ggsel>" . _NONE . "</option>";
          $dummy = 1;
      }
      echo "<option value=\"$row2[id]\" $gsel>$row2[name]</option>";
      $gsel = "";
       }
       echo "</select>&nbsp;<i>(" . _VALIDIFREG . ")</i></td></tr>";
   } else {
       echo "<input type=\"hidden\" name=\"mod_group\" value=\"0\">";
   }
        echo "</select></tr></td>";
        echo "<input type='hidden' name='mid' value='$mid'>";
        echo "<input type='hidden' name='op' value='module_edit_save'>";
        echo "<tr><td align='center' colspan='2'><input type='submit' value='"._SAVECHANGES."'><br>"._GOBACK."</td></tr>";
        echo "</form>";
        echo "</table>";
        CloseTable();
}
    CZModulecopy();
    include("footer.php");
    break;

    case "module_edit_save":
    global  $prefix, $db;
    $mid = intval($mid);
    $view = intval($view);
    $inmenu = intval($inmenu);
    $mcat = intval($mcat);
    $mcat = explode("-", $mcat);
    if ($mcat[1]=="") { $mcat[1] = 0; }
    if ($view != 1) { $mod_group = 0; }
    $result = $db->sql_query("update ".$prefix."_modules set custom_title='$custom_title', view='$view', inmenu='$inmenu', mod_group='$mod_group', mcid='$mcat[0]', url='$url' where mid='$mid'");
    Header("Location: admin.php?op=modules");
    break;

    case "modules_add_category":
    global  $prefix, $db;
    $mcid = intval($mcid);
    $result=$db->sql_query("SELECT * FROM ".$prefix."_modules_categories WHERE mcname='$mcname'");
    $numrows = $db->sql_numrows($result);
    if($numrows > 0){
        include("header.php");
        title(_MODULESADMIN);
        mainmenu();
        OpenTable();
        echo "<br><center><font class='content'>";
        echo "<b>"._ERRORTHECATEGORY." $mcname "._ALREADYEXIST."</b><br><br>";
        echo ""._GOBACK."<br><br>";
        CloseTable();
        CZModulecopy();
        include("footer.php");
    } else {
        $categorysql = $db->sql_query("SELECT * FROM ".$prefix."_modules_categories");
        $numcategories = $db->sql_numrows($categorysql);
        $newposition = $numcategories+1;
        $newposition = intval($newposition);
        $db->sql_query("INSERT INTO ".$prefix."_modules_categories (mcid, mcname, mcposition) VALUES (NULL, '$mcname', $newposition)");
        header("Location: admin.php?op=categories");
    }
    break;

    case "modules_edit_category":
    global  $prefix, $db;
    $mcid = intval($mcid);
    include ("header.php");
    title(_MODULESADMIN);
    mainmenu();
    $cat = explode("-", $cat);
    if ($cat[1]=="") { $cat[1] = 0; }
    OpenTable();
    echo "<center><font class='content'><b>"._MODCATEGORY."</b></font></center><br><br>";
    $result=$db->sql_query("select mcname, visible from ".$prefix."_modules_categories where mcid='$cat[0]'");
    list($mcname, $visible) = $db->sql_fetchrow($result);
    if ($visible == 1) {
        $insel1 = "checked";
        $insel2 = "";
    } elseif ($visible == 0) {
        $insel1 = "";
        $insel2 = "checked";
    }
    echo "<form action='admin.php' method='post'>";
    echo ""._NAME.": <input type='text' name='mcname' value='$mcname' size='51' maxlength='50'><br>";
    echo "Visible? <input type='radio' name='visible' value='1' $insel1> "._YES." &nbsp;&nbsp; <input type='radio' name='visible' value='0' $insel2> "._NO."";
    echo "<input type='hidden' name='mcid' value='$cat[0]'>";
    echo "<input type='hidden' name='op' value='modules_edit_category_save'>";
    echo "<table border='0'><tr><td>";
    echo "<input type='submit' value='"._SAVECHANGES."'></form></td><td>";
    if($cat[0] != 1){
        echo "<form action='admin.php' method='post'>";
        echo "<input type='hidden' name='mcid' value='$cat[0]'>";
        echo "<input type='hidden' name='op' value='modules_delete_category'>";
        echo "<input type='submit' value='"._DELETE."'></form></td>";
    }
    echo "</tr></table>";
    CloseTable();
    CZModulecopy();
    include("footer.php");
    break;

    case "modules_edit_category_save":
    global  $prefix, $db;
    $mcid = intval($mcid);
    $visible = intval($visible);
    $db->sql_query("UPDATE ".$prefix."_modules_categories SET mcname='$mcname', visible='$visible' WHERE mcid='$mcid'");
    Header("Location: admin.php?op=categories");
    break;

    case "modules_delete_category":
    global  $prefix, $db;
    $mcid = intval($mcid);
    if($ok==1) {
        $db->sql_query("UPDATE ".$prefix."_modules SET mcid='1' WHERE mcid='$mcid'");
        $db->sql_query("delete from ".$prefix."_modules_categories where mcid='$mcid'");
        $db->sql_query("optimize table ".$prefix."_modules_categories");
        Header("Location: admin.php?op=modules");
    } else {
        include("header.php");
        title(_MODULESADMIN);
        mainmenu();
        OpenTable();
        echo "<br><center><font class='option'>";
        echo "<b>Are You Sure?</b><br><br>";
        echo "[ <a href='admin.php?op=modules_delete_category&amp;mcid=$mcid&amp;ok=1'>"._YES."</a> | <a href='admin.php?op=modules'>"._NO."</a> ]<br><br>";
        CloseTable();
        CZModulecopy();
        include("footer.php");
    }
    break;

    case "modules_category_up":
    global  $prefix, $db;
    $mcid = intval($mcid);
    $mcposnew = intval($mcposnew);
    $mcposnew = $mcposup+1;
    $mcposup = intval($mcposup);
    $sql = "UPDATE ".$prefix."_modules_categories SET mcposition='$mcposnew' WHERE mcposition='$mcposup'";
    $result = $db->sql_query($sql);
    $sql2 = "UPDATE ".$prefix."_modules_categories SET mcposition='$mcposup' WHERE mcid='$mcid'";
    $result2 = $db->sql_query($sql2);
    if((!$result) || (!$result2)){
        die("There was a problem updating the database");
    } else{
        header("Location: admin.php?op=categories");
    }
    break;

    case "modules_category_down":
    global  $prefix, $db;
    $mcid = intval($mcid);
    $mcposnew = intval($mcposnew);
    $mcposnew = $mcposdown-1;
    $mcposdown = intval($mcposdown);
    $sql = "UPDATE ".$prefix."_modules_categories SET mcposition='$mcposnew' WHERE mcposition='$mcposdown'";
    $result = $db->sql_query($sql);
    $sql2 = "UPDATE ".$prefix."_modules_categories SET mcposition='$mcposdown' WHERE mcid='$mcid'";
    $result2 = $db->sql_query($sql2);
    if((!$result) || (!$result2)){
        die("There was a problem updating the database");
    } else{
        header("Location: admin.php?op=categories");
    }
    break;

      case "modules_config":
   global  $textcolor1, $bgcolor2, $db, $prefix;
   include("header.php");
   title(_MODULESADMIN);
      mainmenu();
   OpenTable();
   $modconf = array();
   $sql = "SELECT * FROM ".$prefix."_modules_config";
   $result = $db->sql_query($sql);
   while(list($config_name, $config_value) = $db->sql_fetchrow($result)){
      $modconf[$config_name] = $config_value;
   }
   echo "<b>"._CONFIGUREMODULEOPTIONS."</b><br><br>"._MODULES_HEREYOUCANCONFIGURE."<br><br>\n";

   echo "<center><b>General Block Configuration</b><br />\n";
      echo "<table width='80%' bgcolor='$textcolor1' cellspacing='1' cellpadding='2'>\n"
      ."<form action='admin.php' method='post'>\n"
            ."<tr bgcolor='$bgcolor2'><td width='40%'>"._MODULES_BLOCKOPENCLOSE."</td><td width='60%'>\n"
      ."&nbsp;&nbsp;&nbsp;\n";
   if($modconf['openclose'] == "1"){
      $spc1 = "";
      $spc2 = "CHECKED";
   }
   else{
      $spc1 = "CHECKED";
      $spc2 = "";
   }
   echo "<input type='radio' name='openclose' value='0' ".$spc1.">&nbsp;"._NO."&nbsp;&nbsp;&nbsp;\n"
      ."<input type='radio' name='openclose' value='1' ".$spc2.">&nbsp;"._YES."</td></tr>\n"
      ."<tr bgcolor='$bgcolor2'><td width='40%'>"._SHOWSEARCHFEATURE."</td><td width='60%'>\n"
      ."&nbsp;&nbsp;&nbsp;\n";
   if($modconf['showsearch'] == "1"){
      $ssl1 = "";
      $ssl2 = "CHECKED";
   }
   else{
      $ssl1 = "CHECKED";
      $ssl2 = "";
   }
   echo "<input type='radio' name='showsearch' value='0' ".$ssl1.">&nbsp;"._NO."&nbsp;&nbsp;&nbsp;\n"
      ."<input type='radio' name='showsearch' value='1' ".$ssl2.">&nbsp;"._YES."</td></tr>\n"
      ."<tr bgcolor='$bgcolor2'><td width='40%'>"._SHOWADMINDROPDOWN."</td><td width='60%'>\n"
      ."&nbsp;&nbsp;&nbsp;\n";
   if($modconf['showdropdown'] == "1"){
      $sdl1 = "";
      $sdl2 = "CHECKED";
   }
   else{
      $sdl1 = "CHECKED";
      $sdl2 = "";
   }
   echo "<input type='radio' name='showdropdown' value='0' ".$sdl1.">&nbsp;"._NO."&nbsp;&nbsp;&nbsp;\n"
      ."<input type='radio' name='showdropdown' value='1' ".$sdl2.">&nbsp;"._YES."</td></tr></table></center>\n";
      echo "<br /><center><b>Quick Links Configuration</b><br /><table width='80%' bgcolor='$textcolor1' cellspacing='1' cellpadding='2'>"
            ."<tr bgcolor='$bgcolor2'><td width='40%'>"._SHOWQUICKLINKS."</td><td width='60%'>\n"
      ."&nbsp;&nbsp;&nbsp;\n";
   if($modconf['showquicklinks'] == "1"){
      $sql1 = "";
      $sql2 = "CHECKED";
   }
   else{
      $sql1 = "CHECKED";
      $sql2 = "";
   }
   echo "<input type='radio' name='showquicklinks' value='0' ".$sql1.">&nbsp;"._NO."&nbsp;&nbsp;&nbsp;\n"
      ."<input type='radio' name='showquicklinks' value='1' ".$sql2.">&nbsp;"._YES."</td></tr>\n"
           ."<tr bgcolor='$bgcolor2'><td width='40%'>"._QUICKLINKS_BLOCKOPENCLOSE."</td><td width='60%'>\n"
      ."&nbsp;&nbsp;&nbsp;\n";
   if($modconf['quicklinksopenclose'] == "1"){
      $sqc1 = "";
      $sqc2 = "CHECKED";
   }
   else{
      $sqc1 = "CHECKED";
      $sqc2 = "";
   }
   echo "<input type='radio' name='quicklinksopenclose' value='0' ".$sqc1.">&nbsp;"._NO."&nbsp;&nbsp;&nbsp;\n"
      ."<input type='radio' name='quicklinksopenclose' value='1' ".$sqc2.">&nbsp;"._YES."</td></tr>\n";

      $quicklinkname = $modconf['quicklinkname'];
      echo "<tr bgcolor='$bgcolor2'><td width='40%'>"._QUICKLINKNAME."<br /></td><td width='60%'>"
            ."&nbsp;&nbsp;&nbsp;<input type=\"text\" name=\"quicklinkname\" value=\"$quicklinkname\" size=\"25\"></td></tr>"
            ."<tr bgcolor='$bgcolor2'><td width='40%'>"._QUICKLINKSTOPBOTTOM."</td><td width='60%'>\n"
      ."&nbsp;&nbsp;&nbsp;\n";
   if($modconf['quicklinksposition'] == "1"){
      $sqp1 = "";
      $sqp2 = "CHECKED";
   }
   else{
      $sqp1 = "CHECKED";
      $sqp2 = "";
   }
   echo "<input type='radio' name='quicklinksposition' value='0' ".$sqp1.">&nbsp;"._QUICKLINKSBOTTOM."&nbsp;&nbsp;&nbsp;\n"
      ."<input type='radio' name='quicklinksposition' value='1' ".$sqp2.">&nbsp;"._QUICKLINKSTOP."</td></tr></table></center><br />\n";
      echo "<br /><center><b>EXLinks Configuration</b><br /><table width='80%' bgcolor='$textcolor1' cellspacing='1' cellpadding='2'>"
            ."<tr bgcolor='$bgcolor2'><td width='40%'>"._EXLINKSACTIVATED."</td><td width='60%'>\n"
      ."&nbsp;&nbsp;&nbsp;\n";
   if($modconf['exlinksactivated'] == "1"){
      $sea1 = "";
      $sea2 = "CHECKED";
   }
   else{
      $sea1 = "CHECKED";
      $sea2 = "";
   }
   echo "<input type='radio' name='exlinksactivated' value='0' ".$sea1.">&nbsp;"._NO."&nbsp;&nbsp;&nbsp;\n"
      ."<input type='radio' name='exlinksactivated' value='1' ".$sea2.">&nbsp;"._YES."</td></tr>\n"
          ."<tr bgcolor='$bgcolor2'><td width='40%'>"._EXLINKS_BLOCKOPENCLOSE."</td><td width='60%'>\n"
      ."&nbsp;&nbsp;&nbsp;\n";
   if($modconf['exlinksopenclose'] == "1"){
      $sexc1 = "";
      $sexc2 = "CHECKED";
   }
   else{
      $sexc1 = "CHECKED";
      $sexc2 = "";
   }
   echo "<input type='radio' name='exlinksopenclose' value='0' ".$sexc1.">&nbsp;"._NO."&nbsp;&nbsp;&nbsp;\n"
      ."<input type='radio' name='exlinksopenclose' value='1' ".$sexc2.">&nbsp;"._YES."</td></tr>\n";

      $exlinksname = $modconf['exlinksname'];
      echo "<tr bgcolor='$bgcolor2'><td width='40%'>"._EXLINKSNAME."<br /></td><td width='60%'>"
            ."&nbsp;&nbsp;&nbsp;<input type=\"text\" name=\"exlinksname\" value=\"$exlinksname\" size=\"25\"></td></tr>"
."<tr bgcolor='$bgcolor2'><td width='40%'>"._EXLINKSTOPBOTTOM."</td><td width='60%'>\n"
      ."&nbsp;&nbsp;&nbsp;\n";
   if($modconf['exlinksposition'] == "1"){
      $sex1 = "";
      $sex2 = "CHECKED";
   }
   else{
      $sex1 = "CHECKED";
      $sex2 = "";
   }
   echo "<input type='radio' name='exlinksposition' value='0' ".$sex1.">&nbsp;"._QUICKLINKSBOTTOM."&nbsp;&nbsp;&nbsp;\n"
      ."<input type='radio' name='exlinksposition' value='1' ".$sex2.">&nbsp;"._QUICKLINKSTOP."</td></tr></table></center><br />\n";
      echo "<center><br /><table width='80%' bgcolor='$textcolor1' cellspacing='1' cellpadding='2'>"
         ."<tr bgcolor='$bgcolor2'><td width='40%'>"._SUBMIT."</td><td>\n"
      ."<input type='hidden' name='op' value='modules_config_save'>\n"
      ."&nbsp;&nbsp;&nbsp;&nbsp;<input type='submit' value='submit'>\n"
      ."&nbsp;&nbsp;&nbsp;<input type='reset' value='Reset'></td></tr>";
      
   echo "</form></table></center>\n";
   CloseTable();
      CZModulecopy();
   include("footer.php");
      break;

   case "modules_config_save":
    $newmodconfig = array();
    $newmodconfig['openclose'] = $openclose;
    $newmodconfig['showsearch'] = $showsearch;
    $newmodconfig['showdropdown'] = $showdropdown;
    $newmodconfig['showquicklinks'] = $showquicklinks;
    $newmodconfig['quicklinkname'] = $quicklinkname;
    $newmodconfig['quicklinksopenclose'] = $quicklinksopenclose;
    $newmodconfig['quicklinksposition'] = $quicklinksposition;
    $newmodconfig['exlinksname'] = $exlinksname;
    $newmodconfig['exlinksopenclose'] = $exlinksopenclose;
    $newmodconfig['exlinksposition'] = $exlinksposition; 
    $newmodconfig['exlinksactivated'] = $exlinksactivated;
    $result = $db->sql_query("SELECT * FROM ".$prefix."_modules_config");
    while(list($config_name, $config_value) = $db->sql_fetchrow($result)){
      $db->sql_query("UPDATE ".$prefix."_modules_config SET config_value='".$newmodconfig[$config_name]."' WHERE config_name='".$config_name."'");
   }
   header("Location: admin.php?op=modules_config");
   break;

    case "modules_exlinks":
    global $admin, $bgcolor2, $prefix, $db;
    $xid = intval($xid);
    include ("header.php");
    mainmenu();
    OpenTable();
    echo "<center><font class=\"title\"><b>"._MODULESEXLINKS."</b></font></center>";
    CloseTable();
    echo "<br>";
    OpenTable();
    echo "<table width=\"100%\" cellpadding=\"4\" cellspacing=\"0\" border=\"0\">"
     ."<tr bgcolor=\"$bgcolor2\"><td width='20%'>"._TITLE."</td><td width='15%' align='center'>"._STATUS."</td><td width='20%' align='center'>"._VIEW."</td><td width='15%' align='center'>"._GROUP."</td><td width='25%' align='center'>"._FUNCTIONS."</td></tr>";
    $sql = "SELECT * FROM ".$prefix."_modules_exlinks ORDER BY title ASC";
    $result = $db->sql_query($sql);
    while ($row = $db->sql_fetchrow($result)) {       
   $xid = intval($row['xid']);
      $title = $row['title'];
      $active = intval($row['active']);
      $view = intval($row['view']);
   $url = $row['url'];
      $target = intval($row['target']);
      $mod_group = intval($row['mod_group']);
         if ($active == 1) {
            $active = "<i>"._ACTIVE."</i>";
            $change = _DEACTIVATE;
            $act = 0;
        } else {
            $active = "<i>"._INACTIVE."</i>";
            $change = _ACTIVATE;
            $act = 1;
        }
        if ($view == 0) {
            $who_view = _MVALL;
        } elseif ($view == 1) {
            $who_view = _MVUSERS;
        } elseif ($view == 2) {
            $who_view = _MVADMIN;
        } elseif ($view == 3) {
       $who_view = _SUBUSERS;
   }

   if ($mod_group != 0) {
       $grp = $db->sql_fetchrow($db->sql_query("SELECT name FROM ".$prefix."_groups WHERE id='$mod_group'"));
       $mod_group = $grp['name'];
   } else {
       $mod_group = _NONE;
   }
   echo "<tr><td colspan=6><hr></td></tr><tr><td><b><a href=\"$url\" title=\"$url\" target=\"_blank\">$title</a>";
      echo "</b></td><td align='center'><b>$active</b></td><td align='center'><b>$who_view</b></td><td align='center'><b>$mod_group</b></td>";
      echo "<td align='center'>[ <a href=\"admin.php?op=modules_exlinks_edit&amp;xid=$xid\">"._EDIT."</a> | <a href=\"admin.php?op=modules_exlinks_del&amp;xid=$xid&amp;ok=0\">"._DELETE."</a> | <a href=\"admin.php?op=modules_exlinks_status&amp;xid=$xid&amp;ok=0\">$change</a> ]</td>";
      echo "</tr>";

   }
    echo "<tr><td colspan=6><hr>";
    echo "</td></tr></table>";
    CloseTable();
    echo "<br>";
    OpenTable();
  echo "<center><font class=\"option\"><b>"._MODULESEXLINKSADD."</b></font></center>"
   ."<form action=\"admin.php\" method=\"post\">"
   ."<table border=\"0\" width=\"100%\"><tr><td>"
   .""._TITLEEX."</td><td><input type=\"text\" name=\"title\" size=\"40\"></td></tr><tr><td>"
   .""._URL."</td><td><input type=\"text\" name=\"url\" size=\"40\">"
   ."</td></tr>";
  echo "<tr><td>"._TARGET."</td><td><select name='target'>";
  echo "<option value='0' selected>same window</option>";
  echo "<option value='1'>new window</option>";
  echo "<option value='2'>popup window</option>";
  echo "</select></tr>";
  echo "<tr><td>"._VIEWPRIV."</td><td><select name='view'>";
  echo "<option value='0' selected>"._MVALL."</option>";
  echo "<option value='1'>"._MVUSERS."</option>";
  echo "<option value='2'>"._MVADMIN."</option>";
  echo "<option value='3'>"._SUBUSERS."</option>";
  echo "</select></td></tr>";
   $numrow = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_groups"));
   if ($numrow > 0) {
       echo "<tr><td>" . _UGROUP . "</td><td><select name=\"mod_group\">";
        $result2 = $db->sql_query("SELECT id, name FROM " . $prefix . "_groups");
        while ($row2 = $db->sql_fetchrow($result2)) {
      if ($row2[id] == $mod_group) { $gsel = "selected"; } else { $gsel = ""; }
      if ($dummy != 1) {
          if ($mod_group == 0) { $ggsel = "selected"; } else { $ggsel = ""; }
          echo "<option value=\"0\" $ggsel>" . _NONE . "</option>";
          $dummy = 1;
      }
      echo "<option value=\"$row2[id]\" $gsel>$row2[name]</option>";
      $gsel = "";
       }
       echo "</select>&nbsp;<i>(" . _VALIDIFREG . ")</i></td></tr>";
   } else {
       echo "<input type=\"hidden\" name=\"mod_group\" value=\"0\">";
   }
      echo "</select></tr></td>";
  echo "<tr><td>"._ACTIVATE."</td><td><input type=\"radio\" name=\"active\" value=\"1\"checked>"._YES." &nbsp;&nbsp;"
      ."<input type=\"radio\" name=\"active\" value=\"0\">"._NO."</td></tr>"   
      ."</table><br>"                                                                                                                                               
   ."<input type=\"hidden\" name=\"op\" value=\"modules_exlinks_add\">"
   ."<input type=\"submit\" value=Add>"
   ."</form>";
    CloseTable();
    CZModulecopy();
    include("footer.php");
    break;


   case "modules_exlinks_add":
    if ($title=="") {
   include("header.php");
   OpenTable();
   echo "<center><font class=\"title\"><b>"._MODULESEXLINKS."</b></font></center>";
   CloseTable();
   echo "<br>";
   OpenTable();
   echo "<br><center>"
       ."<font class=\"content\">"
       ."<b>"._YOUDIDNTADDATITLE."</b><br><br>"
       .""._GOBACK."<br><br>";
   CloseTable();
      CZModulecopy();
   include("footer.php");
    }
    if ($url=="") {
   include("header.php");
   OpenTable();
   echo "<center><font class=\"title\"><b>"._MODULESEXLINKS."</b></font></center>";
   CloseTable();
   echo "<br>";
   OpenTable();
   echo "<br><center>"
       ."<font class=\"content\">"
       ."<b>"._YOUDIDNTADDAURL."</b><br><br>"
       .""._GOBACK."<br><br>";
   CloseTable();
      CZModulecopy();
   include("footer.php");
    }
    $title = stripslashes(FixQuotes($title));
    $url = stripslashes(FixQuotes($url));
    $active = intval($row['active']);
    $view = intval($view);
    $target = intval($target);
    $mod_group = intval($mod_group);
    $db->sql_query("insert into ".$prefix."_modules_exlinks values (NULL, '$title', '$active', '$view', '0', '$url', '$target', $mod_group)");
    if ($target == 2) {
    $result = $db->sql_query("select xid from ".$prefix."_modules_exlinks where url='$url'");
    list($xid) = $db->sql_fetchrow($result);
    $db->sql_query("insert into ".$prefix."_modules_popups values ('$xid', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')");
    Header("Location: admin.php?op=modules_exlinks_popups_setup&pid=$xid");
    } else {
    Header("Location: admin.php?op=modules_exlinks");
}
    break;

    case "modules_exlinks_edit":
    global $bgcolor2, $prefix, $db;
    $xid = intval($xid);
    include ("header.php");
    mainmenu();
    OpenTable();
    echo "<center><font class=\"title\"><b>"._MODULESEXLINKS."</b></font></center>";
    CloseTable();
    echo "<br>";
    $sql = "SELECT * FROM ".$prefix."_modules_exlinks where xid='$xid'";
    $result = $db->sql_query($sql);
    while ($row = $db->sql_fetchrow($result)) {
   $xid = intval($row['xid']);
   $title = $row['title'];
      $view = intval($row['view']);
   $active = intval($row['active']);
      $url = $row['url'];
      $target = intval($row['target']);
      $mod_group = intval($row['mod_group']);
    OpenTable();
    echo "<center><font class=\"option\"><b>"._MODULESEXLINKSEDIT."</b></font></center>"
   ."<form action=\"admin.php\" method=\"post\">"
   ."<input type=\"hidden\" name=\"xid\" value=\"$xid\">"
   ."<table border=\"0\" width=\"100%\"><tr><td>"
   .""._TITLEEX."</td><td><input type=\"text\" name=\"title\" size=\"40\" value=\"$title\"></td></tr><tr><td>"
   .""._URL."</td><td><input type=\"text\" name=\"url\" value=\"$url\" size=\"40\">"
   ."</td></tr>";
    if ($target == 0) {
        $sel11 = "selected";
        $sel22 = "";
        $sel33 = "";
    } elseif ($target == 1) {
        $sel11 = "";
        $sel22 = "selected";
        $sel33 = "";
    } elseif ($target == 2) {
        $sel11 = "";
        $sel22 = "";
        $sel33 = "selected";
    }
$edit_link = "&nbsp;[ <a href=\"admin.php?op=modules_exlinks_popups&amp;pid=$xid\">Edit</a> ]";
     
  echo "<tr><td>"._TARGET."</td><td><select name='target'>";
  echo "<option value='0'$sel11>same window</option>";
  echo "<option value='1'$sel22>new window</option>";
  if ($target == 2) {
  echo "<option value='2'$sel33>popup window</option>";



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum