Closed Thread
Results 1 to 4 of 4

Thread: Help with a custom module for phpnuke

  1. #1
    kacete's Avatar
    kacete is offline x10Hosting Member kacete is an unknown quantity at this point
    Join Date
    Sep 2008
    Location
    Europe
    Posts
    5

    Help with a custom module for phpnuke

    Hello guys, I could use another eyes on this code, i'm trying to make an admin for a custom module. The module and everything works except the admin part to edit an already existing article. It does get the values from the database and displays them on the boxes, but after modifying and clicking Edit to submit the form it doesn't make any changes.

    PHP Code:
        function EditSpecial($sid) {
            global 
    $prefix$db$admin_file;
            include(
    "header.php");
            
    GraphicAdmin();
            
    title(""._SPECIALSMANAGER."");
            
    OpenTable();
            
    $sid intval($sid);
            
    $result $db->sql_query("SELECT * FROM ".$prefix."_specials WHERE sid='$sid'");
            
    $ency $db->sql_fetchrow($result);
            
    $ency['stitle'] = filter($ency['stitle'], "nohtml");
            
    $ency['simg'] = filter($ency['simg'], "nohtml");
            
    $ency['sband'] = filter($ency['sband']);
            
    $ency['stxt'] = filter($ency['stxt']);
            echo 
    "<center><b>"._SPECIALSEDIT."</b></center><br><br>"
            
    ."<form action=\"".$admin_file.".php\" method=\"post\">"
            
    ."<b>"._SPECIALSTITLE.":</b><br>"
            
    ."<input type=\"text\" name=\"stitle\" size=\"50\" maxlength=\"255\" value=\"$ency[stitle]\"><br><br>"
            
    ."<b>"._SPECIALSIMAGE.":</b><br>Located in images/specials/.<br>"
            
    ."<input type=\"text\" name=\"simg\" size=\"50\" maxlength=\"255\" value=\"$ency[simg]\"><br><br>"
            
    ."<b>"._SPECIALSBANDS.":</b><br>"
            
    ."<textarea name=\"sband\" cols=\"100\" rows=\"10\">$ency[sband]</textarea><br><br>"
            
    ."<b>"._SPECIALSTEXT.":</b><br>"
            
    ."<textarea name=\"stxt\" cols=\"100\" rows=\"20\">$ency[stxt]</textarea><br><br>"
            
    ."<input type=\"hidden\" name=\"op\" value=\"SaveEditSpecial\">"
            
    ."<input type=\"hidden\" name=\"sid\" value=\"$sid\">"
            
    ."<input type=\"submit\" value=\""._EDIT."\">"
            
    ."</form>";
            
    CloseTable();
            include(
    "footer.php");
        }

        function 
    SaveEditSpecial($sid$stitle$simg$sband$stxt) {
            global 
    $prefix$db$admin_file;
            
    $sid intval($sid);
            
    $db->sql_query("UPDATE ".$prefix."_specials SET stitle='$stitle' simg='$simg' sband='$sband' stxt='$stxt' WHERE sid='$sid'");
            
    Header("Location: ".$admin_file.".php?op=SpecialsList");
        } 
    Thank you ;)

  2. #2
    xmakina's Avatar
    xmakina is offline x10 Lieutenant xmakina is an unknown quantity at this point
    Join Date
    May 2008
    Location
    England
    Posts
    265

    Re: Help with a custom module for phpnuke

    Er... you remembered to check for the OP value and then call the SaveEditSpecial function, right?
    IF($this->$post.content() == "SEE SIG"){
    w3Schools and Google
    }

  3. #3
    kacete's Avatar
    kacete is offline x10Hosting Member kacete is an unknown quantity at this point
    Join Date
    Sep 2008
    Location
    Europe
    Posts
    5

    Re: Help with a custom module for phpnuke

    Yes, at the end of the file:

    PHP Code:
        switch($op) {
                   
            case 
    "EditSpecial":
            
    EditSpecial($sid);
            break;
                   
            case 
    "SaveEditSpecial":
            
    SaveEditSpecial($sid$stitle$simg$sband$stxt);
            break;
            
        } 
    And again in the case.php file:

    PHP Code:
    switch($op) {

        case 
    "EditSpecial":
        case 
    "SaveEditSpecial";
            
        include(
    "modules/$module_name/admin/index.php");
        break;


    :dunno:
    Edit:
    Just to say that the problem was solved
    Last edited by kacete; 10-27-2008 at 06:30 PM. Reason: Automerged Doublepost
    www.rocknroll.us.to

    I need no signature,
    Ass. kacete.

  4. #4
    DeadBattery's Avatar
    DeadBattery is offline Community Support Team DeadBattery is a name known to allDeadBattery is a name known to all
    Join Date
    Mar 2008
    Location
    localhost
    Posts
    4,019

    Re: Help with a custom module for phpnuke

    Thread Moved to Scripts & 3rd Party Apps
    Since it seems your problem has been fixed, I am closing the thread.
    Thread Closed


Closed Thread

Similar Threads

  1. Joomla 1.5 "x10 hosting ads" module here
    By groovedriver in forum Tutorials
    Replies: 5
    Last Post: 02-28-2009, 03:14 PM
  2. Seas2Success - Custom Banner Offer!
    By loveboat in forum Ads & Offers
    Replies: 9
    Last Post: 02-08-2008, 11:34 PM
  3. PHP Module or CGI
    By Micro in forum Free Hosting
    Replies: 8
    Last Post: 09-30-2006, 07:08 PM
  4. [REQ] phpnuke/postnuke module or php script 100+ points
    By 03moscropl in forum The Marketplace
    Replies: 5
    Last Post: 09-30-2005, 10:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers