Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Modules
Author Message
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1122

PostPosted: Thu Jul 12, 2012 5:05 pm Reply with quote

Anybody converted this module into RaveNuke? I wonder if it is safe to install it? Shocked I like this module. Smile
 
View user's profile Send private message
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sat Jul 14, 2012 10:23 am Reply with quote

If you are questioning whether it is safe to install or not, then I wouldn't. Wink At least until you've gone over the code with a fine tooth comb...

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Sun Jul 15, 2012 10:59 am Reply with quote

It always helps if you can provide a link.

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
hicuxunicorniobestbuildpc







PostPosted: Tue Jul 17, 2012 8:49 am Reply with quote

Here is the link Palbin. I will be really happy to see this module working with RavenNuke 2.5 Very Happy
[ Only registered users can see links on this board! Get registered or login! ]
 
hicuxunicorniobestbuildpc







PostPosted: Thu Jul 26, 2012 8:12 am Reply with quote

Guys, I spent lot of hours cleaning and making this module validated. I am stucked now with some codes I believe they are not compatible with msqli

Please mention the new codes for msqli

These are my modifications and correct me if I am doing something wrong.

One part of the installation is like this

Old
Code:
// First time install

if ($installoption == "firsttimer") {
    opentable();

    echo "Installing Table 1<br>";
    $sql = 'CREATE TABLE `' . $user_prefix . '_sexyornot_votetimes` ('
     . ' `voter_nick` VARCHAR( 255 ) NOT NULL ,'
     . ' `voter_time` VARCHAR( 255 ) NOT NULL ,'
     . ' `voted_on_nick` VARCHAR( 255 ) NOT NULL'
     . ' ) TYPE = MYISAM ;';
    echo "Done with Table 1 ";
    if (mysql_query($sql)) {
   echo "<img src=\"images/green_dot.gif\"><br>";
} else {
$badinstall = "1";
   echo "<img src=\"images/red_dot.gif\"><br>";
}

    echo "Installing Table 2<br>";
    $sql = 'CREATE TABLE `' . $user_prefix . '_sexyornot_viewcounts` ('
     . ' `id` INT( 255 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,'
     . ' `picid` VARCHAR( 255 ) NOT NULL ,'
     . ' `nick` VARCHAR( 255 ) NOT NULL ,'
     . ' `ipaddy` VARCHAR( 255 ) NOT NULL ,'
     . ' `rawtime` INT( 255 ) NOT NULL'
     . ' ) ENGINE = MYISAM ;';

    echo "Done with Table 2 ";
    if (mysql_query($sql)) {
   echo "<img src=\"images/green_dot.gif\"><br>";
} else {
$badinstall = "1";
   echo "<img src=\"images/red_dot.gif\"><br>";
}


New

Code:
// First time install

if ($installoption == "firsttimer") {
    opentable();

    echo "Installing Table 1<br />";
    $sql = 'CREATE TABLE `' . $user_prefix . '_sexyornot_votetimes` ('
     . ' `voter_nick` VARCHAR( 255 ) NOT NULL ,'
     . ' `voter_time` VARCHAR( 255 ) NOT NULL ,'
     . ' `voted_on_nick` VARCHAR( 255 ) NOT NULL'
     . ' ) TYPE = MYISAM ;';
    echo "Done with Table 1 ";
    if ($db->sql_query($sql)) {
   echo "<img src=\"images/green_dot.gif\"><br />";
} else {
$badinstall = "1";
   echo "<img src=\"images/red_dot.gif\"><br />";
}

    echo "Installing Table 2<br />";
    $sql = 'CREATE TABLE `' . $user_prefix . '_sexyornot_viewcounts` ('
     . ' `id` INT( 255 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,'
     . ' `picid` VARCHAR( 255 ) NOT NULL ,'
     . ' `nick` VARCHAR( 255 ) NOT NULL ,'
     . ' `ipaddy` VARCHAR( 255 ) NOT NULL ,'
     . ' `rawtime` INT( 255 ) NOT NULL'
     . ' ) ENGINE = MYISAM ;';

    echo "Done with Table 2 ";
    if ($db->sql_query($sql)) {
   echo "<img src=\"images/green_dot.gif\"><br />";
} else {
$badinstall = "1";
   echo "<img src=\"images/red_dot.gif\"><br />";
}


I changed all the old codes in order to work with RavenNuke but I guess there is something wrong I still need to change.

Problem: When I create a category everything goes well but I can not see the name of the category.

Example from the file admin_create_cat.php

Old

Code:
<?php

//*************************************************
//admin_create_cat.php file for Sexy_or_Not Module by
//White_Devil of http://devil-modz.us
//Wrote for http://Sexy-10.com My Site Also
//E-Mail @ [ Only registered users can see links on this board! Get registered or login! ]
//
//Please do not remove any copyright notices
//Or modify beyond the main parts of this script
//
//Everything is pretty much Explained.
//*************************************************

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}

require_once("mainfile.php");
global $user, $cookie, $prefix, $db, $user_prefix, $row, $admin, $sql;
$module_name = basename(dirname(__FILE__));
$configlocationfile = "modules/$module_name/configfile.php";
include_once("$configlocationfile");
include_once("$mainpath/includes.php");
include_once("header.php");
opentable();
include_once("$mainpath/sexyheader.php");
echo "<br><hr>";

if (is_admin($admin)) {




//Commands to check information.
if ($savecat != "") {

if ($catname == "") {
echo "<center><br><b>"._CREATECATERRORNONAME."<br>";
echo "<a href=\"javascript:history.go(-1);\"><u>"._CREATECATBACK."</u></a><br><br><hr>";
closetable();
include_once("footer.php");
}
if ($catinfo == "") {
echo "<center><br><b>"._CREATECATERRORNODISC."<br>";
echo "<a href=\"javascript:history.go(-1);\"><u>"._CREATECATBACK."</u></a><br><br><hr>";
closetable();
include_once("footer.php");
}
title("Save Category Information");
opentable();

$cat_name = cleantext($catname);
$cat_info = cleantext($catinfo);

$row = $db->sql_fetchrow($db->sql_query("SELECT cat_title FROM ".$prefix."_sexyornot_cat WHERE cat_title='$cat_name'"));
$checkdb = $row['cat_title'];



if ( $checkdb == "" ) {

} else {

echo "<hr><b><i><u><br>"._CREATECATERRORIN."<br>";
echo ""._CREATECATERRORIN2."</u></b></i><br><BR><hr>";
echo "<a href=\"javascript:history.go(-1);\"><u>"._CREATECATBACK."</u></a>";
closetable();
closetable();
include_once("footer.php");
die;
}

echo "<br><b>"._CREATECATGETINFOFROM."...</b><br>";
echo ""._CREATECATNEWCATNAME." = $cat_name <br>";
echo ""._CREATECATNEWCATDISC." = $cat_info <br>";
if ($catvis == "1") {
echo ""._CREATECATNEWCATACTIVE."<br><br>";
} else {
echo ""._CREATECATNEWCATNOTACTIVE."<br><br>";
}

echo "<b>"._CREATECATCONVERNAMETOFOLDER."...</b><br>";
$catname = strip_tags($catname);
$cat_folder = str_replace(" ", "", $catname);
$cat_folder = str_replace("\"", "", $cat_folder);
$cat_folder = str_replace("'", "", $cat_folder);
$cat_folder = str_replace(".", "", $cat_folder);
$cat_folder = str_replace(",", "", $cat_folder);
$cat_folder = substr($cat_folder, 0, 15);
$cat_folder = strtolower($cat_folder);
echo ""._CREATECATFOLDERWILLBENAMED." = $cat_folder<br><br>";
echo "<b>"._CREATECATMAKEFOLDER1."...</b><br>";
$ajpath = "$mainpath/$pic_folder";


if ( !mkdir("$ajpath/$cat_folder") ) {
$ajerror = "1";
} else {
echo ""._CREATECATDONEFOLDER1." = $cat_folder<br>";
if ( !mkdir("$ajpath/$cat_folder/fullsize") ) {
$ajerror = "1";
} else {
echo ""._CREATECATDONEFOLDER1." = $cat_folder/fullsize<br>";
if ( !mkdir("$ajpath/$cat_folder/thumbs") ) {
$ajerror = "1";
} else {
echo ""._CREATECATDONEFOLDER1." = $cat_folder/thumbs<br><br>";
}
}
}

$myuser = get_current_user();
$truepath = getcwd();

$file = "/$ajpath/$cat_folder";

if (! chmod ("$truepath$file", 0777)) {
    echo  ("<hr><hr>"._CREATECATPERMISSIONERROR."<hr><hr>");
}
if (! chmod ("$truepath$file/thumbs", 0777)) {
    echo  ("<hr><hr>"._CREATECATPERMISSIONERROR."<hr><hr>");
}
if (! chmod ("$truepath$file/fullsize", 0777)) {
    echo  ("<hr><hr>"._CREATECATPERMISSIONERROR."<hr><hr>");
}


if ( $ajerror == "1" ) {
echo "<hr><b><i><u><br>"._CREATECATMAINERROR1."<br>";
echo ""._CREATECATMAINERROR2."</u></b></i><br><BR><hr>";
echo "<a href=\"javascript:history.go(-1);\"><u>"._CREATECATBACK."</u></a>";
}






if ( $ajerror != "1" ) {



echo "<b>"._CREATECATSTARTINFOSAVE."...</b><br>";
echo ""._CREATECATWRITETODBSTART."<br>";



$sql = "INSERT INTO ".$prefix."_sexyornot_cat (`cat_id`, `cat_title`, `cat_info`, `cat_path`, `cat_visible`) VALUES ('', '$cat_name', '$cat_info', '$cat_folder', '$catvis')";
mysql_query($sql);

echo ""._CREATECATDONEWRITETODB."<br><br>";

echo "<b>"._CREATECATSUCCESSNOTE1."<br>";
echo "<b>"._CREATECATSUCCESSNOTE2."<br>";
echo "<a href=\"modules.php?name=$module_name&file=admin_main\"><u>"._CREATECATBACK."</u></a><br><br><hr>";




}


closetable();






}

} else {

echo "<center><br><b>"._CREATECATNOTADMIN."<br>";
echo "<a href=\"javascript:history.go(-1);\"><u>"._CREATECATBACK."</u></a><br><br><hr>";
}
closetable();
include_once("footer.php");
?>


New I made by myself

Code:
<?php

//*************************************************
//admin_create_cat.php file for Sexy_or_Not Module by
//White_Devil of http://devil-modz.us
//Wrote for http://Sexy-10.com My Site Also
//E-Mail @ [ Only registered users can see links on this board! Get registered or login! ]
//
//Please do not remove any copyright notices
//Or modify beyond the main parts of this script
//
//Everything is pretty much Explained.
//*************************************************

if (!defined('MODULE_FILE')) { die ('You can\'t access this file directly...'); }

require_once("mainfile.php");
global $user, $cookie, $prefix, $db, $user_prefix, $row, $admin, $sql;
$module_name = basename(dirname(__FILE__));
$configlocationfile = "modules/$module_name/configfile.php";
include_once("$configlocationfile");
include_once("$mainpath/includes.php");
include_once("header.php");
opentable();
include_once("$mainpath/sexyheader.php");
echo "<br /><hr>";

if (is_admin($admin)) {




//Commands to check information.
if ($savecat != "") {

if ($catname == "") {
echo "<center><br /><b>"._CREATECATERRORNONAME."<br />";
echo "<a href=\"javascript:history.go(-1);\"><u>"._CREATECATBACK."</u></a><br /><br /><hr>";
closetable();
include_once("footer.php");
}
if ($catinfo == "") {
echo "<center><br /><b>"._CREATECATERRORNODISC."<br />";
echo "<a href=\"javascript:history.go(-1);\"><u>"._CREATECATBACK."</u></a><br /><br /><hr>";
closetable();
include_once("footer.php");
}
title("Save Category Information");
opentable();

$cat_name = cleantext($catname);
$cat_info = cleantext($catinfo);

$row = $db->sql_fetchrow($db->sql_query("SELECT cat_title FROM ".$prefix."_sexyornot_cat WHERE cat_title='$cat_name'"));
$checkdb = $row['cat_title'];



if ( $checkdb == "" ) {

} else {

echo "<hr><b><i><u><br />"._CREATECATERRORIN."<br />";
echo ""._CREATECATERRORIN2."</u></b></i><br /><BR><hr>";
echo "<a href=\"javascript:history.go(-1);\"><u>"._CREATECATBACK."</u></a>";
closetable();
closetable();
include_once("footer.php");
die;
}

echo "<br /><b>"._CREATECATGETINFOFROM."...</b><br />";
echo ""._CREATECATNEWCATNAME." = $cat_name <br />";
echo ""._CREATECATNEWCATDISC." = $cat_info <br />";
if ($catvis == "1") {
echo ""._CREATECATNEWCATACTIVE."<br /><br />";
} else {
echo ""._CREATECATNEWCATNOTACTIVE."<br /><br />";
}

echo "<b>"._CREATECATCONVERNAMETOFOLDER."...</b><br />";
$catname = strip_tags($catname);
$cat_folder = str_replace(" ", "", $catname);
$cat_folder = str_replace("\"", "", $cat_folder);
$cat_folder = str_replace("'", "", $cat_folder);
$cat_folder = str_replace(".", "", $cat_folder);
$cat_folder = str_replace(",", "", $cat_folder);
$cat_folder = substr($cat_folder, 0, 15);
$cat_folder = strtolower($cat_folder);
echo ""._CREATECATFOLDERWILLBENAMED." = $cat_folder<br /><br />";
echo "<b>"._CREATECATMAKEFOLDER1."...</b><br />";
$ajpath = "$mainpath/$pic_folder";


if ( !mkdir("$ajpath/$cat_folder") ) {
$ajerror = "1";
} else {
echo ""._CREATECATDONEFOLDER1." = $cat_folder<br />";
if ( !mkdir("$ajpath/$cat_folder/fullsize") ) {
$ajerror = "1";
} else {
echo ""._CREATECATDONEFOLDER1." = $cat_folder/fullsize<br />";
if ( !mkdir("$ajpath/$cat_folder/thumbs") ) {
$ajerror = "1";
} else {
echo ""._CREATECATDONEFOLDER1." = $cat_folder/thumbs<br /><br>";
}
}
}

$myuser = get_current_user();
$truepath = getcwd();

$file = "/$ajpath/$cat_folder";

if (! chmod ("$truepath$file", 0777)) {
    echo  ("<hr><hr>"._CREATECATPERMISSIONERROR."<hr><hr>");
}
if (! chmod ("$truepath$file/thumbs", 0777)) {
    echo  ("<hr><hr>"._CREATECATPERMISSIONERROR."<hr><hr>");
}
if (! chmod ("$truepath$file/fullsize", 0777)) {
    echo  ("<hr><hr>"._CREATECATPERMISSIONERROR."<hr><hr>");
}


if ( $ajerror == "1" ) {
echo "<hr><b><i><u><br />"._CREATECATMAINERROR1."<br />";
echo ""._CREATECATMAINERROR2."</u></b></i><br /><BR><hr>";
echo "<a href=\"javascript:history.go(-1);\"><u>"._CREATECATBACK."</u></a>";
}






if ( $ajerror != "1" ) {



echo "<b>"._CREATECATSTARTINFOSAVE."...</b><br />";
echo ""._CREATECATWRITETODBSTART."<br />";



$sql = "INSERT INTO ".$prefix."_sexyornot_cat (`cat_id`, `cat_title`, `cat_info`, `cat_path`, `cat_visible`) VALUES ('', '$cat_name', '$cat_info', '$cat_folder', '$catvis')";
$db->sql_query($sql);

echo ""._CREATECATDONEWRITETODB."<br /><br />";

echo "<b>"._CREATECATSUCCESSNOTE1."<br />";
echo "<b>"._CREATECATSUCCESSNOTE2."<br />";
echo "<a href=\"modules.php?name=$module_name&file=admin_main\"><u>"._CREATECATBACK."</u></a><br /><br /><hr>";




}


closetable();






}

} else {

echo "<center><br /><b>"._CREATECATNOTADMIN."<br />";
echo "<a href=\"javascript:history.go(-1);\"><u>"._CREATECATBACK."</u></a><br /><br /><hr>";
}
closetable();
include_once("footer.php");


Please help me with this. Is this correct or is mkdir deprecated?

I need to know what codes we should use to make or fix modules in order to work for RavenNuke.

Shocked

Note: I've been changing lots of things on this module. I didn't upload it yet. If you want I can upload it. Let me know. I talked with the author and he is not going to update this module to work with RavenNuke. Almost no old module works with RavenNuke. Sad

Is this correct?

OLD
Code:
$sql="SELECT * FROM ".$prefix."_sexyornot_files where file_approve='0'";

$result=mysql_query($sql);
$num=mysql_numrows($result);


NEW

Code:
$sql="SELECT * FROM ".$prefix."_sexyornot_files where file_approve='0'";

$result=$db->sql_query($sql);
$num=$db->sql_numrows($result);


All these old deprecated functions has been replace it but I guess I'm missing something.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Modules

View next topic
View previous topic
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 can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©