Clan Adverts

Sponsors

CT on Facebook

Latest Product

User Box

Anonymous
38.107.179.216
Nickname:

Password:

Security Code
Security Code
Type Security Code


PND Downloads Feed

Phpnuke Downloads
How to Delete or Reset yo...
How to Delete or Reset your PHPNuke Admin Account
Lost your admin password ?  Cant login to your admin account ?This sh...
Back Online & Stuff
Back Online & Stuff
Look at us with our nifty website back up and running… Seriousl...
How to edit the admins in...
How to edit the admins in the forums
Here is a way to make someone admin in your forums on your Evo site. I...
Demo Splash Screen
Demo Splash Screen
Ped @ Clan Themes has released a simple splash screen entrance hack. ...
Free Phpnuke Business The...
Free Phpnuke Business Theme 6
This is the 6th Business theme for Phpnuke that Clan Themes has releas...
Tricked Out Slider
Tricked Out Slider
We have seen some great new things come out of Tricked Out News and th...

Custom Work

PHP Nuke Custom Work

www.clanthemes.com :: View topic - Conflict with module administration
Conflict with module administration

7 Replies / 595 Views


Post new topic   Reply to topic  

   www.clanthemes.com Forum Index » Modules

View previous topic :: View next topic


Ishtar
Reputation: 0.8 Add RepSubtract Rep
Local time: 8:04 AM


Noob
Noob

0.01 posts per day
Medals: 0

Joined: Mar 07, 2010
Last Visit: 10 Mar 2010
Posts: 7
Points: 224 

Post Conflict with module administration Posted: Tue Mar 09, 2010 12:33 am

Hi all!!!
I made a module clonation(reviews)and all worked OK, except the admin access. I have two reviews admin icons, the problem is both of them link to /admin.php?op=reviews.

The original module is called reviews and links to /modules.php?name=Reviews.
My cloned module is called reviews2 and links to /modules.php?name=Reviews2
Any help would be welcome!
 

 
View user's profileSend private messageSend e-mail Reply with quote

Ped
Reputation: 64 Add RepSubtract Rep
votes: 35
Local time: 9:04 AM
Location: Great British Empire
uk.gif

Site Founder
Site Founder

2.33 posts per day
Medals: 2 (View more...)
Super Dedicated User (Amount: 1)
Theme Guru
Theme Guru
Joined: Nov 13, 2006
Last Visit: 10 Feb 2012
Posts: 4467
Points: 181246 

Post Re: Conflict with module administration Posted: Tue Mar 09, 2010 3:10 am

Shop Purchases:
Clan Roster 2.0 · Bad Company 2 Vietnam Xtreme Theme

look inside

modules/reviews/admin/links.php

change

Code:
.php?op=reviews


to

Code:
.php?op=reviews2
 

 
View user's profileSend private messageSend e-mail Reply with quote

Snype
Reputation: 305.5 Add RepSubtract Rep
votes: 8
Local time: 8:04 AM
Location: lincolshire
uk.gif



0.60 posts per day
Medals: 1 (View more...)
Site Supporter (Amount: 1)
Respected Member
Respected Member
Joined: May 20, 2008
Last Visit: 06 Nov 2011
Posts: 812
Points: 60742 

Post Conflict with module administration Posted: Tue Mar 09, 2010 9:48 am

Shop Purchases:
Call of Duty 4 SAS Theme

You also need to change the case.php

to match the new changes
 

WebSite > http://www.phpnukeblog.info Xfire > DDsnype MSN > ritchietaylor@live.co.uk Email > admin@phpnukeblog.info  
View user's profileSend private messageVisit poster's websiteMSN Messenger Reply with quote


Ishtar
Reputation: 0.8 Add RepSubtract Rep
Local time: 8:04 AM


Noob
Noob

0.01 posts per day
Medals: 0

Joined: Mar 07, 2010
Last Visit: 10 Mar 2010
Posts: 7
Points: 224 

Post Conflict with module administration Posted: Tue Mar 09, 2010 11:57 am

When I apply these changes and enter in admin reviews 2 shows a blank page (http://www.metal666.org/cms/admin.php?op=reviews2)

Here is my reviews2/admin/case.php

Code:
if ( !defined('ADMIN_FILE') )
{
   die("Illegal File Access");
}
global $admin_file;
if (!stristr($_SERVER['SCRIPT_NAME'], "".$admin_file.".php")) { die ("Access Denied"); }

$module_name = explode( "admin", dirname( __FILE__ ) );
$module_name = basename( $module_name[0] );

if(file_exists("modules/$module_name/admin/language/lang-".$currentlang.".php")){
include_once("modules/$module_name/admin/language/lang-".$currentlang.".php");
}

switch($op) {

    case "reviews2":
    case "mod_main":
    case "add_review":
    include("modules/$module_name/admin/index.php");
    break;

}

?>


And here is my reviews2/admin/links.php

Code:
if ( !defined('ADMIN_FILE') )
{
   die("Illegal File Access");
}
global $admin_file;
if (!stristr($_SERVER['SCRIPT_NAME'], "".$admin_file.".php")) { die ("Access Denied"); }
adminmenu("".$admin_file.".php?op=reviews2", ""._REVIEWS."", "reviews2.gif");

?>


Any help would be welcome. Angel
 

 
View user's profileSend private messageSend e-mail Reply with quote

Snype
Reputation: 305.5 Add RepSubtract Rep
votes: 8
Local time: 8:04 AM
Location: lincolshire
uk.gif



0.60 posts per day
Medals: 1 (View more...)
Site Supporter (Amount: 1)
Respected Member
Respected Member
Joined: May 20, 2008
Last Visit: 06 Nov 2011
Posts: 812
Points: 60742 

Post Conflict with module administration Posted: Tue Mar 09, 2010 4:00 pm

Shop Purchases:
Call of Duty 4 SAS Theme

Ok it aint just as simple as that my friend you need to now open the index.php and rename all the functions() to match the case.php
so as an example you would need to find this
Code:
function reviews() {

and change to this
Code:
function reviews2() {

and so on.... with all the functions as they are what trigger the case.php to display that function in a url like /admin.php?op=reviews2
(i think i explained that well lol) hope it works m8
 

 
View user's profileSend private messageVisit poster's websiteMSN Messenger Reply with quote

Ishtar
Reputation: 0.8 Add RepSubtract Rep
Local time: 8:04 AM


Noob
Noob

0.01 posts per day
Medals: 0

Joined: Mar 07, 2010
Last Visit: 10 Mar 2010
Posts: 7
Points: 224 

Post Conflict with module administration Posted: Tue Mar 09, 2010 7:16 pm

Ohh thank you very much but it doesn't work...

I really need that clonation, to run alphabetical bands,reviews,and other like this. I don't know what to do. I have tried all!
Any help would be welcome!

Here is my /reviews2/admin/index.php,maybe I did something wrong;

Code:
if ( !defined('ADMIN_FILE') )
{
   die("Illegal File Access");
}
global $admin_file;
if (!stristr($_SERVER['SCRIPT_NAME'], "".$admin_file.".php")) { die ("Access Denied"); }
$module_name = explode("admin",dirname( __FILE__ ));
$module_name = basename($module_name[0]);
   if(is_adminmod($module_name)){

/*********************************************************/
/* REVIEWS Block Functions                               */
/*********************************************************/

function mod_main($title, $description) {
    global $prefix, $db, $admin_file;
    $title = stripslashes(FixQuotes($title));
    $description = stripslashes(FixQuotes($description));
    $db->sql_query("update ".$prefix."_reviews2_main set title='$title', description='$description'");
    Header("Location: ".$admin_file.".php?op=reviews2");
}

function reviews2() {
    global $prefix, $db, $multilingual, $admin_file;
    include ("header.php");
   
    GraphicAdmin();
    OpenTable();
    echo "<center><font class=\"title\"><b>"._REVADMIN."</b></font></center>";
    CloseTable();
    echo "<br>";
    $resultrm = $db->sql_query("select title, description from ".$prefix."_reviews2_main");
    list($title, $description) = $db->sql_fetchrow($resultrm);
    OpenTable();
    echo "<form action=\"".$admin_file.".php\" method=\"post\">"
   ."<center>"._REVTITLE."<br>"
   ."<input type=\"text\" name=\"title\" value=\"$title\" size=\"50\" maxlength=\"100\"><br><br>"
   .""._REVDESC."<br>"
   ."<textarea name=\"description\" rows=\"15\" wrap=\"virtual\" cols=\"60\">$description</textarea><br><br>"
   ."<input type=\"hidden\" name=\"op\" value=\"mod_main\">"
   ."<input type=\"submit\" value=\""._SAVECHANGES."\">"
   ."</form></center>";
    CloseTable();
    echo "<br>";
    OpenTable();
    echo "<center><font class=\"option\"><b>"._REVWAITING."</b></font><br>";
    $result = $db->sql_query("select * from ".$prefix."_reviews2_add order by id");
    $numrows = $db->sql_numrows($result);
    if ($numrows>0) {
   while(list($id, $date, $title, $text, $reviewer, $email, $score, $url, $url_title, $rlanguage) = $db->sql_fetchrow($result)) {
       $id = intval($id);
       $score = intval($score);
       $title = stripslashes($title);
       $text = stripslashes($text);
       echo "<form action=\"".$admin_file.".php\" method=\"post\">"
      ."<hr noshade size=\"1\"><br><table border=\"0\" cellpadding=\"1\" cellspacing=\"2\">"
      ."<tr><td><b>"._REVIEWID.":</td><td><b>$id</b></td></tr>"
      ."<input type=\"hidden\" name=\"id\" value=\"$id\">"
      ."<tr><td>"._DATE.":</td><td><input type=\"text\" name=\"date\" value=\"$date\" size=\"11\" maxlength=\"10\"></td></tr>"
      ."<tr><td>"._PRODUCTTITLE.":</td><td><input type=\"text\" name=\"title\" value=\"$title\" size=\"25\" maxlength=\"40\"></td></tr>";
       if ($multilingual == 1) {
      echo "<tr><td>"._LANGUAGE.":</td><td>"
          ."<select name=\"rlanguage\">";
      $handle=opendir('language');
      while ($file = readdir($handle)) {
          if (preg_match("/^lang\-(.+)\.php/", $file, $matches)) {
              $langFound = $matches[1];
              $languageslist .= "$langFound ";
              }
      }
      closedir($handle);
      $languageslist = explode(" ", $languageslist);
      sort($languageslist);
      for ($i=0; $i < sizeof($languageslist); $i++) {
          if($languageslist[$i]!="") {
         echo "<option value=\"$languageslist[$i]\" ";
         if($languageslist[$i]==$rlanguage) echo "selected";
         echo ">".ucfirst($languageslist[$i])."</option>\n";
          }
      }
      echo "</select></td></tr>";
       } else {
      echo "<input type=\"hidden\" name=\"rlanguage\" value=\"$language\">";
       }
       echo "<tr><td>"._TEXT.":</td><td><TEXTAREA name=\"text\" rows=\"6\" wrap=\"virtual\" cols=\"40\">$text</textarea></td></tr>"
      ."<tr><td>"._REVIEWER."</td><td><input type=\"text\" name=\"reviewer\" value=\"$reviewer\" size=\"41\" maxlength=\"40\"></td></tr>"
      ."<tr><td>"._EMAIL.":</td><td><input type=\"text\" name=\"email\" value=\"$email\" size=\"41\" maxlength=\"80\"></td></tr>"
      ."<tr><td>"._SCORE."</td><td><input type=\"text\" name=\"score\" value=\"$score\" size=\"3\" maxlength=\"2\"></td></tr>";
       if ($url != "") {
      echo "<tr><td>"._RELATEDLINK.":</td><td><input type=\"text\" name=\"url\" value=\"$url\" size=\"25\" maxlength=\"100\"></td></tr>"
          ."<tr><td>"._LINKTITLE.":</td><td><input type=\"text\" name=\"url_title\" value=\"$url_title\" size=\"25\" maxlength=\"50\"></td></tr>";
       }
       echo "<tr><td>"._IMAGE.":</td><td><input type=\"text\" name=\"cover\" size=\"25\" maxlength=\"100\"><br><i>"._REVIMGINFO."</i></td></tr></table>";
       echo "<input type=\"hidden\" name=\"op\" value=\"add_review\"><input type=\"submit\" value=\""._ADDREVIEW."\"> - [ <a href=\"".$admin_file.".php?op=deleteNotice&amp;id=$id&amp;table=".$prefix."_reviews2_add&amp;op_back=reviews\">"._DELETE."</a> ]</form>";
   }
    } else {
       echo "<br><br><i>"._NOREVIEW2ADD."</i><br><br>";
    }
    echo "<a href=\"modules.php?name=Reviews2&rop=write_review\">"._CLICK2ADDREVIEW."</a></center>";
    CloseTable();
    echo "<br>";
    OpenTable();
    echo "<center><font class=\"option\"><b>"._DELMODREVIEW."</b></font><br><br>"
   .""._MODREVINFO."</center>";
    CloseTable();
    include ("footer.php");
}

function add_review2($id, $date, $title, $text, $reviewer, $email, $score, $cover, $url, $url_title, $rlanguage) {
    global $prefix, $db, $admin_file;
    $id = intval($id);
    $title = stripslashes(FixQuotes($title));
    $text = stripslashes(FixQuotes($text));
    $reviewer = stripslashes(FixQuotes($reviewer));
    $email = stripslashes(FixQuotes($email));
    $score = intval($score);
    $db->sql_query("insert into ".$prefix."_reviews values (NULL, '$date', '$title', '$text', '$reviewer', '$email', '$score', '$cover', '$url', '$url_title', '1', '$rlanguage')");
    $db->sql_query("delete from ".$prefix."_reviews2_add WHERE id = '$id'");
    Header("Location: ".$admin_file.".php?op=reviews2");
}

switch ($op){

    case "reviews":
    reviews();
    break;

    case "add_review":
    add_review($id, $date, $title, $text, $reviewer, $email, $score, $cover, $url, $url_title, $rlanguage);
    break;

    case "mod_main":
    mod_main($title, $description);
    break;

}

} else {
    msgmodnoallow($module_name);
}

?>

Retard
 

 
View user's profileSend private messageSend e-mail Reply with quote


Snype
Reputation: 305.5 Add RepSubtract Rep
votes: 8
Local time: 8:04 AM
Location: lincolshire
uk.gif



0.60 posts per day
Medals: 1 (View more...)
Site Supporter (Amount: 1)
Respected Member
Respected Member
Joined: May 20, 2008
Last Visit: 06 Nov 2011
Posts: 812
Points: 60742 

Post Conflict with module administration Posted: Tue Mar 09, 2010 8:08 pm

Shop Purchases:
Call of Duty 4 SAS Theme

Have you created that reviews2 table? and have you made it the exact same as the reviews table? also what is the problem you are getting any errors? Also turn on error_reporting from the config.php it will show you the error then post back here
 

 
View user's profileSend private messageVisit poster's websiteMSN Messenger Reply with quote

Ishtar
Reputation: 0.8 Add RepSubtract Rep
Local time: 8:04 AM


Noob
Noob

0.01 posts per day
Medals: 0

Joined: Mar 07, 2010
Last Visit: 10 Mar 2010
Posts: 7
Points: 224 

Post Re: Conflict with module administration Posted: Tue Mar 09, 2010 11:18 pm

Snype wrote:
Have you created that reviews2 table? and have you made it the exact same as the reviews table? also what is the problem you are getting any errors? Also turn on error_reporting from the config.php it will show you the error then post back here


Much appreciated Snype!
Yes,I think I created without a problem these tables, I think. Anyway, I'm going to start a new nuke installation, so I will open a new topic with all the cloning steps to do it with 0 errors when the nuke new installation is finished,
take care;) Dont Know Kiss
 

 
View user's profileSend private messageSend e-mail Reply with quote
Post new topic   Reply to topic  
   www.clanthemes.com Forum Index » Modules


 
7 Replies / 595 Views
Page 1 of 1
All times are GMT
Display posts from previous:   
 
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 can download files in this forum