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
Doulos
Life Cycles Becoming CPU Cycles



Joined: Jun 06, 2005
Posts: 732

PostPosted: Thu Mar 14, 2019 11:58 am Reply with quote

Why would I need to do that? Public write access to .htaccess? I don't get these warnings on my main site (PHP5.4). All error reporting settings are the same, and file permissions are 644.

Please explain.
 
View user's profile Send private message
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1772

PostPosted: Fri Mar 15, 2019 12:32 am Reply with quote

CHMOD 666 is not a public write access, it allows only the owner of the file to write into it. My guess was that the specific user settings are incorrect or maybe the file is located on a restricted area, where the apache can not read it. Did you checked, if the path to this file is correct? Is it a local installation on XAMPP, WAMP etc?

_________________
Github: RavenNuke 
View user's profile Send private message
Doulos







PostPosted: Fri Mar 15, 2019 2:41 am Reply with quote

This is a domain on a VPS using WHM/cPanel with PHP 7.0.33. Files are in public_html just as they are in my PHP 5.4.45 install on the same server. I have never had this problem before, though this is the only domain I have tried RN with PHP7.
 
Doulos







PostPosted: Tue Mar 19, 2019 4:19 am Reply with quote

I'm an idiot - I had the path to .ftaccess wrong.
 
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6432

PostPosted: Tue Mar 19, 2019 9:26 am Reply with quote

I've done that many times...glad you found it!

_________________
I search, therefore I exist...
nukeSEO - nukeFEED - nukePIE - nukeSPAM - nukeWYSIWYG
 
View user's profile Send private message
Doulos







PostPosted: Wed May 01, 2019 4:50 am Reply with quote

I have been slowly working my way through my custom modules and updating them for PHP7, but I am stuck with this one. I thought I had this module working fine in php5.4, but I just checked my PHP5.4 version of the same website and am getting the same error.
Code:
Parse error: syntax error, unexpected 'OpenTable' (T_STRING), expecting ',' or ';' in /home/php7user/public_html/modules/Contact_Form/index.php on line 79



Here is the module:
Code:
<?php

/************************************************************************/
/* PHP-NUKE: NUKE4GAMERS Clan Join Form */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org & http://www.nuke4gamers.com */
/* */
/* Optimized for RN25x by neralex (c)2014 http://www.media.soefm.de */
/* */
/* This program is free software. You can redistribute it */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/* Need help with the block then drop by http://www.nuke4gamers.com */
/************************************************************************/
 
if (!defined('MODULE_FILE')) die('You can\'t access this file directly...');
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
global $sitename, $user;
 
$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) {
$index = 1; // auto set right blocks for pre patch 3.1 compatibility
}
 
$subject = $sitename . ' ' . _JOINUS;
 
# set here your email-adresses
$sendfrom_email = 'webmaster@****.com';
$receiver_email = '*****@****.net';
 
if(!defined('_YOURAGE')) define('_YOURAGE','Age');
if(!defined('_YOURGENDER')) define('_YOURGENDER','Gender');
if(!defined('_YOURLOCATION')) define('_YOURLOCATION','Location');
if(!defined('_TELLUSMORE')) define('_TELLUSMORE','Anything else you want to tell us?');
 
if (!isset($op)) $op = '';
if (!isset($age)) $age = '';
if (!isset($gender)) $gender = '';
if (!isset($address)) $address = '';
if (!isset($city)) $city = '';
if (!isset($state)) $state = '';
if (!isset($message)) $message = '';
if (!isset($phone)) $phone = '';
if (!isset($first_name)) $first_name = '';
if (!isset($last_name)) $last_name = '';
if (!isset($other_email)) $other_email = '';
if (!isset($country)) $country = '';
if (!isset($gaming_name)) $gaming_name = '';
 
if (is_user($user)) {
$userinfo = getusrinfo($user);
$sender_name = $userinfo['username'];
$sender_email = $userinfo['user_email'];
} else {
$userinfo = false;
$sender_name = '';
$sender_email = '';
}
 
switch($op) {
 
case 'sendform':
csrf_check();
sendform($sender_name, $sender_email, $other_email, $first_name, $last_name, $address, $city, $state, $zip, $country, $phone, $age, $message);
break;
 
default:
index();
break;
 
}
 
function index() {
global $sitename, $module_name, $sender_name, $sender_email;
include_once 'header.php';
echo '<div class="display-none">', PHP_EOL # hide content, when colorbox is not open
    ,'<div id="cbox-test" class="text-center">HELLO WORLD!</div>', PHP_EOL #content of colorbox
   ,'</div>', PHP_EOL;
$cbox_test = '<script type="text/javascript">' . PHP_EOL
    . '    $.colorbox({ open:true, inline:true, href:"#cbox-test", width:"600px", height:"300px" });' . PHP_EOL
    . '</script>' . PHP_EOL;
addJSToBody($cbox_test,'inline');
OpenTable();
echo '<div class="text-center thick">' , PHP_EOL
, '<span style="font-size:20px;">' , $sitename , '</span>' , PHP_EOL
, '<br />' , PHP_EOL
, '<span style="font-size:14px;">' , _JUSTITLE , '</span>' , PHP_EOL
, '<br /><br />' , PHP_EOL
, '<span style="font-size:14px;">' , _JUSNOTE , '</span>' , PHP_EOL
, '<br /><span style="font-size:14px;">' , _JUSNOTE2 , '</span>' , PHP_EOL
, '</div>' , PHP_EOL
, '<br />' , PHP_EOL
, '<form method="post" action="modules.php?name=' , $module_name , '">' , PHP_EOL
, '<div class="">' , PHP_EOL
, '<table width="100%"><tr><td width="25%"></td><td sytle="padding-left:30px"><span class="thick">' , _YOURNAME , ':</span>&nbsp&nbsp';
if ($sender_name != '') {
echo'<span style="font-size:12px; text-decoration:bold;">' , $sender_name , '</span>';
} else {
echo '<input type="text" name="sender_name" value="" />';
}
echo '</p>' , PHP_EOL
, '<p><span class="thick">' , _YOUREMAIL , ':</span>&nbsp&nbsp';
if ($sender_email != '') {
echo'<span style="font-size:12px; text-decoration:bold;">' , $sender_email , '</span>';
} else {
echo '<input type="text" name="sender_email" value="" />';
}
echo '</p>' , PHP_EOL
, '<p><span class="thick"> Other Email :</span>&nbsp&nbsp;<input type="text" name="other_email" value="" size="40" /><br />' , PHP_EOL
, '<span class="thick"> First Name :</span>&nbsp&nbsp;<input type="text" name="first_name" value="" size="20" required /><br />' , PHP_EOL
, '<span class="thick"> Last Name :</span>&nbsp&nbsp;<input type="text" name="last_name" value="" size="20" required /><br />' , PHP_EOL
, '<span class="thick"> Address :</span>&nbsp&nbsp;<input type="text" name="address" value="" size="60" required /><br />' , PHP_EOL
, '<span class="thick"> City :</span>&nbsp&nbsp;<input type="text" name="city" value="" size="15" required /><br />' , PHP_EOL
, '<span class="thick"> State :</span>&nbsp&nbsp;<input type="text" name="state" value="" size="15" required /><br />' , PHP_EOL
, '<span class="thick"> Zip Code :</span>&nbsp&nbsp;<input type="text" name="zip" value="" size="15" required /><br />' , PHP_EOL
, '<span class="thick"> Country :</span>&nbsp&nbsp;<input type="text" name="country" value="" size="15" required /><br />' , PHP_EOL
, '<span class="thick"> Phone # :</span>&nbsp&nbsp;<input type="text" name="phone" value="" size="15" required /><br />' , PHP_EOL
, '<span class="thick"> Age :</span>&nbsp&nbsp;<input type="text" name="age" value="" size="3" required /><br />' , PHP_EOL
, '<tr>' , PHP_EOL
, '<td colspan="2">&nbsp;</td>' , PHP_EOL
, '</tr>' , PHP_EOL
, '</td></tr></table></div>' , PHP_EOL
, '<div class="text-center">' , PHP_EOL
, '<span class="thick">' , _TELLUSMORE , '</span>:' , PHP_EOL
, '<br />' , PHP_EOL
, '<textarea name="message" cols="70" rows="15"></textarea>' , PHP_EOL
, '</div>' , PHP_EOL
, '<br />' , PHP_EOL
, '<center>' , PHP_EOL
, '<input type="hidden" name="op" value="sendform" />' , PHP_EOL
, '<input type="submit" name="submit" value="' , _SEND , '" />' , PHP_EOL
, '</center>' , PHP_EOL
, '</div>' , PHP_EOL
, '<br />' , PHP_EOL
, '</form>' , PHP_EOL;
CloseTable();
include_once 'footer.php';
}
 
function sendform($sender_name, $sender_email, $other_email, $first_name, $last_name, $address, $city, $state, $zip, $country, $phone, $age, $message) {
global $sitename, $module_name, $op, $send, $subject, $sendfrom_email, $receiver_email;

if ($send == 'no') {

} else {
$sender_name = htmlspecialchars_decode(check_html(trim($sender_name), 'nohtml'), ENT_QUOTES);
$sender_email = htmlspecialchars_decode(check_html(trim($sender_email), 'nohtml'), ENT_QUOTES);
$location = htmlspecialchars_decode(check_html($location, 'nohtml'), ENT_QUOTES);
$message = htmlspecialchars_decode(check_html($message, 'nohtml'), ENT_QUOTES);
 
$msg = $sitename . "- Member Contact Info\r\n";
$msg .=  " " . "\r\n";
$msg .= "Forum User Name: " . $sender_name . "\r\n";
$msg .= "Registered Email: "  . $sender_email . "\r\n";
$msg .= "Name: " . $first_name . " " . $last_name ."\r\n";
$msg .= "Address: " . $address . "\r\n";
$msg .= "         " . $city . ", " . $state . " " . $zip . ", " . $country . "\r\n";
$msg .= "Phone #: " . $phone . "\r\n";
$msg .= "Age: " . $age . "\r\n";
$msg .=  " " . "\r\n";
$msg .= "Message: ". $message . "\r\n\r\n";
 
$header = 'From: ' . $sendfrom_email . "\r\n";
$header .= 'Reply-To: ' . $sender_email. "\r\n";
$header .= 'X-Mailer: PHP/' . phpversion() . "\r\n";
$header .= 'MIME-Version: 1.0' . "\n";
$header .= 'Content-type: text/plain; charset=utf-8' . "\r\n";
 
if (@mail($receiver_email, $subject, $msg, $header)) {
include_once 'header.php';
OpenTable();
echo '<div class="text-center">' , PHP_EOL
, '<p>' , _JUSMAILSENT , '</p>' , PHP_EOL
, '<p>' , _JUSTHANKSFORCONTACT , '</p>' , PHP_EOL
, '</div>' , PHP_EOL;
CloseTable();
include_once 'footer.php';
}
}
}
?>


Any suggestions?


Last edited by Doulos on Sat May 18, 2019 10:34 pm; edited 1 time in total 
neralex







PostPosted: Wed May 01, 2019 12:23 pm Reply with quote

Just a typo at the end of a echo-string:

find:
php Code:
include_once 'header.php';echo '<div class="display-none">', PHP_EOL # hide content, when colorbox is not open    ,'<div id="cbox-test" class="text-center">HELLO WORLD!</div>', PHP_EOL #content of colorbox    ,'</div>', PHP_EOL;$cbox_test = '<script type="text/javascript">' . PHP_EOL    . '    $.colorbox({ open:true, inline:true, href:"#cbox-test", width:"600px", height:"300px" });' . PHP_EOL    . '</script>' . PHP_EOL;addJSToBody($cbox_test,'inline');


change it to:

php Code:
include_once 'header.php';

echo '<div class="display-none">', PHP_EOL # hide content, when colorbox is not open
,'<div id="cbox-test" class="text-center">HELLO WORLD!</div>', PHP_EOL #content of colorbox
,'</div>', PHP_EOL;
$cbox_test = '<script type="text/javascript">' . PHP_EOL
. ' $.colorbox({ open:true, inline:true, href:"#cbox-test", width:"600px", height:"300px" });' . PHP_EOL
. '</script>' . PHP_EOL;
addJSToBody($cbox_test,'inline');


Wink
 
Doulos







PostPosted: Wed May 01, 2019 1:11 pm Reply with quote

Thanks ... again.
 
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1122

PostPosted: Tue May 07, 2019 6:15 am Reply with quote

Code:
      // BB code [b]word[/b] [i]word[/i] [u]word[/u]

      if ((eregi("[b]", $comment)) AND (eregi("[/b]", $comment)) AND (substr_count("$comment","[b]") == substr_count("$comment","[/b]"))) {
         $comment = eregi_replace("\[b\]","<span style=\"font-weight: bold\">","$comment");
         $comment = eregi_replace("\[\/b\]","</span>","$comment");
      }
      if ((eregi("[i]", $comment)) AND (eregi("[/i]", $comment)) AND (substr_count("$comment","[i]") == substr_count("$comment","[/i]"))) {
         $comment = eregi_replace("\[i\]","<span style=\"font-style: italic\">","$comment");
         $comment = eregi_replace("\[\/i\]","</span>","$comment");
      }
      if ((eregi("[u]", $comment)) AND (eregi("[/u]", $comment)) AND (substr_count("$comment","[u]") == substr_count("$comment","[/u]"))) {
         $comment = eregi_replace("\[u\]","<span style=\"text-decoration: underline\">","$comment");
         $comment = eregi_replace("\[\/u\]","</span>","$comment");
      }

Guys,I am getting this error

Fatal error: Uncaught Error: Call to undefined function eregi() in:

Should I use preg_match() (with the i (PCRE_CASELESS) modifier)?
 
View user's profile Send private message
neralex







PostPosted: Tue May 07, 2019 10:30 am Reply with quote

As the error message says, there is anymore a function eregi - it is deprecated and you can't use it anymore. You have to find another way.

Without to know how the content of the variable: $comment is builded, I would replace eregi(...) with preg_match(...) and eregi_replace(...) with str_replace(...)
 
hicuxunicorniobestbuildpc







PostPosted: Fri May 10, 2019 8:12 am Reply with quote

Code:
    $sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` ORDER BY `id` DESC LIMIT ".$offset1.",".$aCount['aCount'];

   $nameresult = $db->sql_query($sql);
   $x = 1;
   while ($shout = $db->sql_fetchrow($nameresult)) {
      $comment = str_replace('src=', 'src="', $shout['comment']);
      $comment = str_replace('.gif>', '.gif" alt="" />', $comment);
      $comment = str_replace('.jpg>', '.jpg" alt="" />', $comment);
      $comment = str_replace('.png>', '.png" alt="" />', $comment);
      $comment = str_replace('.bmp>', '.bmp" alt="" />', $comment);
      $comment = str_replace("http:", "".$sbURL."http:", $comment);
      $comment = str_replace("ftp:", "".$sbURL."ftp:", $comment);

      // BB code [b]word[/b] [i]word[/i] [u]word[/u]
      if ((preg_match("[b]", $comment)) AND (preg_match("[/b]", $comment)) AND (substr_count("$comment","[b]") == substr_count("$comment","[/b]"))) {
         $comment = str_replace("\[b\]","<span style=\"font-weight: bold\">","$comment");
         $comment = str_replace("\[\/b\]","</span>","$comment");
      }
      if ((preg_match("[i]", $comment)) AND (preg_match("[/i]", $comment)) AND (substr_count("$comment","[i]") == substr_count("$comment","[/i]"))) {
         $comment = str_replace("/\[i\]/i","<span style=\"font-style: italic\">","$comment");
         $comment = str_replace("/\[\/i\]/i","</span>","$comment");
      }
      if ((preg_match("[u]", $comment)) AND (preg_match("[/u]", $comment)) AND (substr_count("$comment","[u]") == substr_count("$comment","[/u]"))) {
         $comment = str_replace("\[u\]i","<span style=\"text-decoration: underline\">","$comment");
         $comment = str_replace("\[\/u\]i","</span>","$comment");
      }
 
hicuxunicorniobestbuildpc







PostPosted: Fri May 10, 2019 8:12 am Reply with quote

I am not getting more errors but I guess something is wrong.
 
neralex







PostPosted: Fri May 10, 2019 11:34 pm Reply with quote

ZIP or RAR this script with all related files and send a download link via PM. I will check it.
 
Doulos







PostPosted: Fri May 31, 2019 5:15 am Reply with quote

I would like to give a great big thank you to neralex and anyone else who has contributed to RN252. I finally was able to get the time to update all my custom modules and blocks to work with PHP7.0.33.

I am happy to say that I updated a site to RN252/PHP7.0.33 that has been running RN since 2005 and it has been working great for a week now with no logged errors, or reported issues.

Thanks for all your hard work
 
neralex







PostPosted: Fri May 31, 2019 5:33 am Reply with quote

Great, that is working for you.

RavensScripts
 
hicuxunicorniobestbuildpc







PostPosted: Sun Jun 02, 2019 4:48 am Reply with quote

Code:
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /modules/Forums/attach_mod/posting_attachments.php on line 1204



When making a new post u get this error above.

Line 1204

Code:
$this->attach_filename = preg_replace("/([\xC2\xC3])([\x80-\xBF])/e", "chr(ord('\\1')<<6&0xC0|ord('\\2')&0x3F)", $this->attach_filename);


I replaced with

Code:
$this->attach_filename = preg_replace_callback("/([\xC2\xC3])([\x80-\xBF])/e", "chr(ord('\\1')<<6&0xC0|ord('\\2')&0x3F)", $this->attach_filename);


but I still get errors.
 
neralex







PostPosted: Sun Jun 02, 2019 7:30 am Reply with quote

hicuxunicorniobestbuildpc wrote:
Code:
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /modules/Forums/attach_mod/posting_attachments.php on line 1204



When making a new post u get this error above.

Line 1204

Code:
$this->attach_filename = preg_replace("/([\xC2\xC3])([\x80-\xBF])/e", "chr(ord('\\1')<<6&0xC0|ord('\\2')&0x3F)", $this->attach_filename);


I replaced with

Code:
$this->attach_filename = preg_replace_callback("/([\xC2\xC3])([\x80-\xBF])/e", "chr(ord('\\1')<<6&0xC0|ord('\\2')&0x3F)", $this->attach_filename);


but I still get errors.


Good catch - try this:

php Code:
					$this->attach_filename = preg_replace_callback(

"/([\xC2\xC3])([\x80-\xBF])/",
function($m) {
return chr(ord($m[1])<<6&0xC0|ord($m[2])&0x3F);
},
$this->attach_filename
);
 
hicuxunicorniobestbuildpc







PostPosted: Sun Jun 02, 2019 12:54 pm Reply with quote

Cheers Wave

I noticed we need to use the whole function.

function and return together.
 
Doulos







PostPosted: Mon Jun 03, 2019 2:01 am Reply with quote

I spoke too soon, I guess. All seemed to be working fine so I updated my RN2.51 site to RN 2.52. All again seem fine until someone tried to register a new username. I then uploaded a fresh set of RN2.52 files and was getting this error:Please be sure all entered information is correct or apply for a new account here..

Any Idea what is wrong?
 
neralex







PostPosted: Mon Jun 03, 2019 7:59 am Reply with quote

Doulos, did you already activated the module nukeSPAM (for Administrators only)? If yes, did you already clicked on the module-icon?

When both steps are done, then go the nukeSPAM admin-section and press SAVE on all three tabs (Operations, Spam Databases, DNS Blacklists). After that all possible options should be created/updated in the database and you can try it again. nukeSPAM is a very powerful addon and it schouldn't be missed in any installation. I know this is a bit complicated on this way, without to set the options in the database while the installation/upgrade. I'll find a way to simplify it.

Hint: After an RN-upgrade, you should clear your browser-cache. Because the jQuery libraries and also many plugins were updated.
 
Doulos







PostPosted: Mon Jun 03, 2019 1:31 pm Reply with quote

None of that worked. I have installed a fresh copy and confirmed the problem is with my conversion of my old site - new users are created as expected on the fresh site.
Guess I'll have to start over updating my old site.

Thanks for your replies.
 
neralex







PostPosted: Mon Jun 03, 2019 1:42 pm Reply with quote

Ok, then you have to compare only the Your_Account module files.
 
Doulos







PostPosted: Tue Jun 04, 2019 5:01 am Reply with quote

That and the IPN feature of the donation module is not working. I thought I had updated it correctly and got no errors, and the IPN config check came back OK, but new donations are not posted. As soon as I reverted back to php5.4 it started working again. Wish I had more time to actually learn php but working 70+ hours/week, family, and church don't leave much time for myself.
 
Doulos







PostPosted: Thu Jun 20, 2019 1:11 pm Reply with quote

I thought I had this issue once before and posted about it here but forum search came up empty...
Qoutes show up fine in the preview but when actually posted it is inserting backslashes like this [quote:84168ad344=\"Doulos\"]

I re-uploaded the forum module files from the RavenNuke-master to my main site and am still getting the issue. Any idea where I would look?
 
neralex







PostPosted: Fri Jun 21, 2019 9:14 am Reply with quote

Doulos wrote:
I thought I had this issue once before and posted about it here but forum search came up empty...
Qoutes show up fine in the preview but when actually posted it is inserting backslashes like this [quote:84168ad344=\"Doulos\"]

I re-uploaded the forum module files from the RavenNuke-master to my main site and am still getting the issue. Any idea where I would look?


Try to replace this file: includes/kses/kses.php (backup this file before)
 
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 ©