Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x
Author Message
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1012
Location: Netherland

PostPosted: Sat Jul 28, 2012 6:43 pm Reply with quote

Guys, I searched on this forums for more than 30 minutes to answer some questions about the layer conversion and the new functions to use with mysqli on RavenNuke but unfortunatetly I coudn't find so many results.

I found this one which I understand very well but since we have this version of RavenNuke almost none of old blocks and modules work with RavenNuke and I would like to get examples of new functions in order to update myself and to be able to make new modules.

I found this link which I do know very well and I got the point.
[ Only registered users can see links on this board! Get registered or login! ]

Example of what I got learned myself.

old

Code:
if (eregi("block-Shout_Box.php",$_SERVER['PHP_SELF'])) {

    Header("Location: index.php");
    die();
}


new and everybody should use it if you make any new module.

Code:
if ( !defined('BLOCK_FILE') ) {

   Header('Location: ../index.php');
   die();
}


Old

Code:
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {

    die ("You can't access this file directly...");
}


New and the right way to do it is:

Code:
if(!defined('MODULE_FILE')) {

   header('Location: ../../index.php');
   die();
}


or

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


Old

Code:
include("header.php");


New

Code:
include_once('header.php');


Note: How is possible to be able to make a new module when there is nowhere explanation of what we should use with new mysqli functions. I was never so confused with this version. Lots of secrets to discover.

New way to hide right blocks

Code:
$index = 0;

if (!defined('INDEX_FILE')) define('INDEX_FILE', true); // Set to FALSE to hide right blocks
if (defined('INDEX_FILE') AND INDEX_FILE === true) {
   // auto set right blocks for pre patch 3.1 compatibility
   $index = 1;
}


This part above is really beautiful and should be the correct way.

Now it comes some questions.

I noticed these codes all the time but in the wiki there is no explanation about it.

Code:
         echo '<div class="text-center centered">' . PHP_EOL

            . '   <p class="title">' . $sitename . '</p>' . PHP_EOL
            . '   <br /><br />' . _NOINFO4TOPIC . '<br /><br />' . PHP_EOL
            . '   [ <a href="modules.php?name=News">' . _GOTONEWSINDEX . '</a> | <a href="top.htmlics">' . _SELECTNEWTOPIC . '</a> ]' . PHP_EOL
            . '</div>';


We are using this piece of code at the end ' . PHP_EOL of any html tags. What is that and why are we using that suddenly?

Does ' . PHP_EOL must come with this code:

Code:
if (!defined('PHP_EOL')) define ('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\r\n" : "\n");


RavenNuke became really difficult to understand and in my case I do want to do my homework and update all my old modules. I don't want any help or wait for ghost authors or people who abandoned already the field or maybe they are very busy and no time. I got the point but I'm not gonna wait for what is not present.

Maybe it will come lots of question why I don't create new modules or vs. Of course I want to create new things but since there is not good explanations how to create or fix them. I don't want to be a NukeStalker as neralex said to me which I think it is very funny from him and I think this guy could be a good help in the future or RavenNuke.

Maybe you think I only want you to help me or I want you to do it for me. No, I do want to do it myself but since there is only negative things and not good details in what we are talking it is impossible to learn from you. Maybe I am a hard student to understand but believe me. I've got never so many missing parts in a lesson and this could be because of your advance knowledges. I understand it but some other people wants to learn to. Yesterday, Almost everyday I spend hours testing, searching for issues. In the past I started creating new modules. It was really easy. Now it is useless...I can't even know how to star. I hope you understand my point. This is not my language and that could be an issue sometimes.


Clarify this please.

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>";


That piece of code doesn't work with RavenNuke but

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>";



I have this

Code:
$result=$db->sql_query($sql);

$num=mysql_numrows($result);
$content .= "<a href=\"modules.php?name=$module_name&file=big&id=$fileid\">$num Comment(s)</a> || ";
$content .= "<a href=\"modules.php?name=$module_name\">More...</a>";



How to convert this part

Code:
$num=mysql_numrows($result);



Of course I tried many ways.

Code:
$num=$db->sql_numrows($result);
I got errors If I do this.

I got this

Code:
$sql = "DELETE FROM ".$user_prefix."_sexyornot_comments WHERE `com_pic_id` = $fileid";

mysql_query($sql);
echo ""._DELFILCOMMENTTABLE."<br>";



I tried

Code:
$sql = "DELETE FROM ".$user_prefix."_sexyornot_comments WHERE `com_pic_id` = $fileid";

$db->sql_query($sql);
echo ""._DELFILCOMMENTTABLE."<br />";



Neither worked!

That's why I can not understand what function we should use to replace the old code. I read the folder from RavenNuke which says deprecated. Those things I know but do not answer my questions.

Sorry if I make this forum long but I think I do have lots of questions about this new version.
 
View user's profile Send private message Visit poster's website
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1531

PostPosted: Sat Jul 28, 2012 7:15 pm Reply with quote

I think all of the new mysqli statements are commented in msqli.php. Why don't you try a look in this file? You found in this file many answers to your questions. The rest you will found on php.net! PHP_EOL is an constant to define the End Of Line. Its for me a good way to get a clear code-view in the browser without using double slashes.


Last edited by neralex on Sun Jul 29, 2012 2:36 am; edited 1 time in total 
View user's profile Send private message
hicuxunicorniobestbuildpc







PostPosted: Sat Jul 28, 2012 8:05 pm Reply with quote

What change should I do to these codes?

Code:
$file_id = mysql_result($result, $i, "file_id");

$file_cat = mysql_result($result, $i, "file_cat");
$file_name = mysql_result($result, $i, "file_name");
$file_comment = mysql_result($result, $i, "file_comment");
$file_score = mysql_result($result, $i, "file_score");
$file_total_votes = mysql_result($result, $i, "file_total_votes");
$file_member = mysql_result($result, $i, "file_member");
$file_last_rate = mysql_result($result, $i, "file_last_rate");
$file_one = mysql_result($result, $i, "file_one");
$file_two = mysql_result($result, $i, "file_two");
$file_three = mysql_result($result, $i, "file_three");
$file_four = mysql_result($result, $i, "file_four");
$file_five = mysql_result($result, $i, "file_five");
$file_six = mysql_result($result, $i, "file_six");
$file_seven = mysql_result($result, $i, "file_seven");
$file_eight = mysql_result($result, $i, "file_eight");
$file_nine = mysql_result($result, $i, "file_nine");
$file_ten = mysql_result($result, $i, "file_ten");
$file_approve = mysql_result($result, $i, "file_approve");
$ip_address = mysql_result($result, $i, "file_ip_addy");
$row = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$user_prefix."_sexyornot_cat WHERE cat_id='$file_cat'"));
$cat_id = $row['cat_id'];
$cat_title = $row['cat_title'];
$cat_info = $row['cat_info'];
$cat_path = $row['cat_path'];
$cat_visible = $row['cat_visible'];
$something1 = $row['cat_visible'];



Can you give me an example, plz? Question

Quote:
Its for me a good way to get a clear code-view in the browser without using double slashes.


I understand that neralex but where, how to use it? That is my question. Bang Head
 
neralex







PostPosted: Sun Jul 29, 2012 3:04 am Reply with quote

What do you search is not a copy & paste solution. Without a intensive look into the code of the module is that not easy to say. You have posted self an example of PHP_EOL. The question is, in which context you want to use the functions. Without the informations is it hard to understand, what do you want.

BTW Look into a theme.php an search for opentable. I think you will see the solution with the first view. Also you can do it with the rest of modules. Activate the error-reporting and the rnlogs in the rnconfig.php. But be carefull, do it only on a local environment. Search in the existent modules for examples and try it out. The best one is, you install a local server like xampp or wamp on your pc and try it all with a local test environment. If you do it online, you will risk security issues.


Last edited by neralex on Sun Jul 29, 2012 10:55 am; edited 2 times in total 
hicuxunicorniobestbuildpc







PostPosted: Sun Jul 29, 2012 4:33 am Reply with quote

Today I will install RaveNuke 2.5 on my server. This is the module I try to update but I get lots of errors. It doesn't work with RavenNuke.
[ Only registered users can see links on this board! Get registered or login! ]
 
montego
Site Admin



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

PostPosted: Sun Jul 29, 2012 11:20 am Reply with quote

Some information is on the Wiki. Not sure if this helps:
[ Only registered users can see links on this board! Get registered or login! ]

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







PostPosted: Sun Jul 29, 2012 1:39 pm Reply with quote

I read all this already and to tell you the truth I can not understand it at all. I need to see examples. Can you just convert the first file index.php from the old module I post above? The rest I will do it myself but I need to know and compare why this module is not working. Thanks for the link.
 
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17087

PostPosted: Tue Jul 31, 2012 3:01 pm Reply with quote

unicornio,

This kind of help is not w/i the normal and accepted standards for forum help. I would suggest that you try placing a post in the Help Wanted forum and offer to pay someone to do conversions.
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x

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 ©