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: Sat Nov 09, 2019 4:40 am Reply with quote

Got it. I doubt if I'll remember it, but for now I got it.

Thanks.
 
View user's profile Send private message
Doulos







PostPosted: Thu Dec 12, 2019 12:17 pm Reply with quote

Getting this in error log:
Code:
[12-Dec-2019 06:45:44 America/Chicago] PHP Notice:  Undefined variable: sid in /home/meme
/public_html/modules/News/friend.php on line 26
 
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1772

PostPosted: Thu Dec 12, 2019 1:35 pm Reply with quote

Thanks for the report.

This is not a real issue. This is the result, when you request this file outside of the functinality. If you are logged in as user and your are using the "Send to a Friend" link from a story of the News module, you will get a form, where you can enter "Your Friend's Name" and "Your Friend's E-mail". If you are not logged in, then you get a redirect to the full article-view of the story. Only if you doesn't pass the variable into this function, then you get this warning. This behavoir is outside of the logic of the functionality but it is not a bad idea to prevent this usage.

Example: click

If you want prevent this warning, you could add an header-redirect to the index before the variable: $sid is used in this file.

Find:
php Code:
$pagetitle = '- ' . _RECOMMEND;


Add after:
php Code:
if (empty($sid)) {Header('Location: index.php');}


Note: added to the github repo: [ Only registered users can see links on this board! Get registered or login! ]

Wink

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







PostPosted: Sun Dec 15, 2019 4:41 pm Reply with quote

Getting a bunch of these is log:
Code:
PHP Warning:  preg_match(): Unknown modifier 't' in /home/meme/public_html/includes/nukesentinel.php on line 479
 
neralex







PostPosted: Mon Dec 16, 2019 10:15 am Reply with quote

In the current build this line doesn't have a modifier 't'. Did you replace it with the file from the master-branch?
[ Only registered users can see links on this board! Get registered or login! ]
 
Doulos







PostPosted: Mon Dec 16, 2019 12:27 pm Reply with quote

Yes, same result. The logs show several instances of what I posted, and several with other "modifiers". Sorry, I didn't want to post the whole thing - and I've deleted it now. I don't understand it good enough to even tell you what the modifier is in that line - but I think it is / . I saw another post here where someone suggested trying to replace / with # to see if that worked. I assumed it meant something like this:
Code:
if (isset($name) && !preg_match('^name=' . $name . '/i', $pg) && stristr($nsnst_const['script_name'], 'modules.php')) { $mod_check = 1; }


I thought I'd check here to see if you agreed before I changed it to
Code:
if (isset($name) && !preg_match('#^name=' . $name . '#i', $pg) && stristr($nsnst_const['script_name'], 'modules.php')) { $mod_check = 1; }
 
neralex







PostPosted: Tue Dec 17, 2019 12:45 am Reply with quote

I don't get these warnings. Which PHP-version you are using and which settings you have enabled in Sentinel? Can you please post the link to the thread, which you mean?

On all my local installations and also here on RPS with PHP 7.3.12 I don't get these warnings with enabled IP tracking and full PHP error-reporting.
 
kd8hho
Worker
Worker



Joined: Mar 30, 2009
Posts: 132

PostPosted: Tue Dec 17, 2019 12:31 pm Reply with quote

I just made a new site, (i got bored and its been awhile lol) anyway using the latest RN (php7) everything seems to work fine outside of nukespam. it does not give me a way to put in my SFS and PHpot api keys, any ideas how to fix? I was thinking maybe sql didn't install correctly and was missing something but I found the lines in the db and attempted to manually enter the key via phpmyadmin but the key gets wiped out.

_________________
Linux Register User #481509 | Ubuntu Register User #25492 
View user's profile Send private message Visit poster's website
Doulos







PostPosted: Tue Dec 17, 2019 12:41 pm Reply with quote

neralex wrote:
I don't get these warnings. Which PHP-version you are using and which settings you have enabled in Sentinel? Can you please post the link to the thread, which you mean?

On all my local installations and also here on RPS with PHP 7.3.12 I don't get these warnings with enabled IP tracking and full PHP error-reporting.


Actually, I just noticed that is is not a post about preg_match() but here is where I got the idea from [ Only registered users can see links on this board! Get registered or login! ]

PHP 7.3.12, IP tracking enabled. This is a cPanel account and I am looking at logs in /home/meme/logs/meme_com.php.error.log. No errors are showing up in /public_html

i have no idea what is happening to cause the errors. I have been unable to actually cause it intentionally - they just show up in the log.
 
neralex







PostPosted: Tue Dec 17, 2019 3:13 pm Reply with quote

kd8hho wrote:
I just made a new site, (i got bored and its been awhile lol) anyway using the latest RN (php7) everything seems to work fine outside of nukespam. it does not give me a way to put in my SFS and PHpot api keys, any ideas how to fix? I was thinking maybe sql didn't install correctly and was missing something but I found the lines in the db and attempted to manually enter the key via phpmyadmin but the key gets wiped out.


Darn, this was my fault. Bang Head

Let me say THANK YOU for this report! It was a simple logic-mistake while fixing some PHP7-warnings some moons ago.

You can fix it easily, just open /modules/nukeSPAM/admin/nukeSPAMConfig.php and find:

php Code:
if (!empty($key) && !empty($seo_config[$key])) {


Replace it with:

php Code:
if (!empty($key) && isset($seo_config[$key])) {


You can also download this file again from the master-branch on github and replace it with yours.

FYI: just added to the github repo: [ Only registered users can see links on this board! Get registered or login! ]

Wink
 
neralex







PostPosted: Tue Dec 17, 2019 3:17 pm Reply with quote

Doulos, thank you. I will test it in the next days and keep an eye on it. Somewhere is the cause for these warnings.
 
kd8hho







PostPosted: Tue Dec 17, 2019 4:02 pm Reply with quote

neralex wrote:
Darn, this was my fault. Bang Head

Let me say THANK YOU for this report! It was a simple logic-mistake while fixing some PHP7-warnings some moons ago.
Wink


Welcome, it is kind of an important thing lol. the fix you gave fixes the issue.
 
Doulos







PostPosted: Wed Dec 18, 2019 3:55 am Reply with quote

FYI, this did not stop the PHP warnings for this issue:

neralex wrote:
Thanks for the report.

This is not a real issue. This is the result, when you request this file outside of the functinality. If you are logged in as user and your are using the "Send to a Friend" link from a story of the News module, you will get a form, where you can enter "Your Friend's Name" and "Your Friend's E-mail". If you are not logged in, then you get a redirect to the full article-view of the story. Only if you doesn't pass the variable into this function, then you get this warning. This behavoir is outside of the logic of the functionality but it is not a bad idea to prevent this usage.

Example: click

If you want prevent this warning, you could add an header-redirect to the index before the variable: $sid is used in this file.

Find:
php Code:
$pagetitle = '- ' . _RECOMMEND;


Add after:
php Code:
if (empty($sid)) {Header('Location: index.php');}


Note: added to the github repo: [ Only registered users can see links on this board! Get registered or login! ]

Wink
 
neralex







PostPosted: Wed Dec 18, 2019 8:08 am Reply with quote

Not sure from which files you are getting all these warnings but not from this file because you can not use it anymore without enter a sid-value in the URL. If the sid is empty, then you get an redirect to the index. Do you have an older installation of RN running on your server, besides the patched php7 package?
 
Doulos







PostPosted: Wed Dec 18, 2019 1:34 pm Reply with quote

neralex wrote:
Not sure from which files you are getting all these warnings but not from this file because you can not use it anymore without enter a sid-value in the URL. If the sid is empty, then you get an redirect to the index. Do you have an older installation of RN running on your server, besides the patched php7 package?


No, only RN252. However, it is modified and then upgraded 2.51 version that I incrementally updated as you posted things to this thread, not one built up from a fresh install. Whenever I find a warning (or error) the first thing I do is upload the files referenced as well as all known associated files to the server. I am finding that in many cases the files on the server are a different size than those being uploaded. In the latest case of this warning all files were the same size as the latest Git master-branch. I always update my local copy of the master-branch before uploading.

Sorry if this is causing you troubles trying to fix my issues.
 
neralex







PostPosted: Wed Dec 18, 2019 2:52 pm Reply with quote

Ok please test it with this link-example and replace the sid-value with a value of an existing Story-id (sid) in your database.

/modules.php?name=News&file=friend&op=FriendSend&sid=4

Then remove the sid-value from the link in your browser-bar, hit enter and check your php error-logs. If the issue still exist, then you should get a new log-entry.
 
Doulos







PostPosted: Thu Dec 19, 2019 3:47 am Reply with quote

Works exactly as you said it should. No error with sid - index page without sid. Makes no sense to me why I am still getting this warning occasionally.

Anyway, here is the latest
Code:
[19-Dec-2019 00:25:16 America/Chicago] PHP Notice:  Undefined index: y in /home/clanfga/public_html/modules/GCalendar/viewweek.php on line 252

[19-Dec-2019 00:25:16 America/Chicago] PHP Notice:  Undefined index: m in /home/clanfga/public_html/modules/GCalendar/viewweek.php on line 253
[19-Dec-2019 00:25:16 America/Chicago] PHP Notice:  Undefined index: d in /home/clanfga/public_html/modules/GCalendar/viewweek.php on line 254


Yes, the files are from the latest git master
 
neralex







PostPosted: Thu Dec 19, 2019 11:43 am Reply with quote

Doulos wrote:
Anyway, here is the latest
Code:
[19-Dec-2019 00:25:16 America/Chicago] PHP Notice:  Undefined index: y in /home/clanfga/public_html/modules/GCalendar/viewweek.php on line 252

[19-Dec-2019 00:25:16 America/Chicago] PHP Notice:  Undefined index: m in /home/clanfga/public_html/modules/GCalendar/viewweek.php on line 253
[19-Dec-2019 00:25:16 America/Chicago] PHP Notice:  Undefined index: d in /home/clanfga/public_html/modules/GCalendar/viewweek.php on line 254


Yes, the files are from the latest git master


Thanks, it is fixed: [ Only registered users can see links on this board! Get registered or login! ]
 
kd8hho







PostPosted: Fri Dec 20, 2019 11:43 am Reply with quote

one thing bugs me, RSS feeds in the blocks is there any way we can get the rss feed link to open in a new tab?
 
neralex







PostPosted: Fri Dec 20, 2019 11:59 am Reply with quote

kd8hho wrote:
one thing bugs me, RSS feeds in the blocks is there any way we can get the rss feed link to open in a new tab?


EDIT: Removed because wrong block-file!


Last edited by neralex on Sun Dec 22, 2019 4:01 am; edited 1 time in total 
kd8hho







PostPosted: Fri Dec 20, 2019 12:12 pm Reply with quote

neralex wrote:
kd8hho wrote:
one thing bugs me, RSS feeds in the blocks is there any way we can get the rss feed link to open in a new tab?


EDIT: Removed because wrong block-file!


not working for me, still opens in current window. chromium/linux
 
neralex







PostPosted: Sat Dec 21, 2019 6:47 am Reply with quote

At first to make one thing clear - this not a BUG - this is only based your own personal preferences.

If you are using the built-in function in the Blocks-Administration, then you can only modify the mainfile.php but this is not recommanded because after each upgrade to a new version, you will have to modify it again. So make you a notice on a save place for reminding on this.

open mainfile.php and find:

php Code:
$content .= '<a href="' . $item->get_permalink() . '" title="';


Replace it with:

php Code:
$content .= '<a target="_blank" href="' . $item->get_permalink() . '" title="';


BTW: a simple click on your mouse-wheel just do it.

Wink
 
kd8hho







PostPosted: Sat Dec 21, 2019 3:01 pm Reply with quote

neralex wrote:
At first to make one thing clear - this not a BUG - this is only based your own personal preferences.

If you are using the built-in function in the Blocks-Administration, then you can only modify the mainfile.php but this is not recommanded because after each upgrade to a new version, you will have to modify it again. So make you a notice on a save place for reminding on this.

open mainfile.php and find:

php Code:
$content .= '<a href="' . $item->get_permalink() . '" title="';


Replace it with:

php Code:
$content .= '<a target="_blank" href="' . $item->get_permalink() . '" title="';


BTW: a simple click on your mouse-wheel just do it.

Wink


thanks, that was the ticket. I had done it before on a old site I had some years ago but could not for the life of me remember how I did it. (I been away from the game for a long while now lol)

(i have forgot a lot, since I had the heart attack back in sept. my memory is well bad.)

the last thing I hope, Downloads admin - add download. wasn't there a browser upload function? I see in the submit downloads module the only way to add is via browser upload, I was thinking browser upload was also in the downloads admin but I don't see it, just the text box for manually linking url.
 
Doulos







PostPosted: Sat Dec 21, 2019 7:28 pm Reply with quote

Another one:
Code:
[21-Dec-2019 18:18:45 America/Chicago] PHP Warning:  array_keys() expects parameter 1 to be array, string given in /home/meme/public_html/modules/Your_Account/public/new_confirm.php on line 159
 
neralex







PostPosted: Sun Dec 22, 2019 3:51 am Reply with quote

kd8hho, no worries.

There is no upload-function inside the Downloads-Administration. It makes also not really sense to a add it because it comes along with to many server-sided limitations. If you have file-access via FTP, you can paste the path in the form. If not, you can paste a path to a external source without to get trouble with limitations like upload-size etc, which can only be controlled by an server-admin. On shared-hosting you will reached the limitations quickly.


Last edited by neralex on Sun Dec 22, 2019 4:12 am; edited 1 time in total 
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 ©