Ravens PHP Scripts: Forums
 

 

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



Joined: Aug 13, 2009
Posts: 1122

PostPosted: Fri Jun 21, 2013 5:39 am Reply with quote

I need to convert this module in order to work for RavenNuke. Does anyone test this module with RavenNuke. I am getting some errors and the feed doesn't work.

Let me know who wants to convert it.

Code:
Warning: intval() expects parameter 2 to be long, string given in /modules/Multiheadlines/admin/index.php on line 456


Warning: Division by zero in /modules/Multiheadlines/index.php on line 32
 
View user's profile Send private message
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Fri Jun 21, 2013 8:21 am Reply with quote

I'm not sure which version I used last (I no longer us it) but I did pass a number of bug fixes back to the original developer.
The intval error looks weird because you can only pass one parameter into it, not two.
 
View user's profile Send private message Send e-mail
hicuxunicorniobestbuildpc







PostPosted: Fri Jun 21, 2013 4:40 pm Reply with quote

I contacted as well and he doesn't respond. I am running the last version. Can u please take a look and let me know what is going on. I will send a donation as soon as u finish it if u have time. I want to use google news on my website. Thank in advance.
 
Guardian2003







PostPosted: Sun Jun 23, 2013 4:04 am Reply with quote

Sorry but I'm really busy right now and am going to be tied up until probably the end of September.
 
hicuxunicorniobestbuildpc







PostPosted: Mon Jun 24, 2013 6:02 pm Reply with quote

I guess nobody is interesting in fixing this module. Sad


Last edited by hicuxunicorniobestbuildpc on Fri Jul 05, 2013 5:51 am; edited 1 time in total 
hicuxunicorniobestbuildpc







PostPosted: Fri Jul 05, 2013 5:50 am Reply with quote

I fixed all error from Division by zero but I guess the mayor problem still there. It is not saving the news in data base. The news is not showing. Any clue guys.
 
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6433

PostPosted: Mon Jul 08, 2013 7:34 pm Reply with quote

It might be easier if you posted more details - like error messages in your cPanel log, error.log or RavenNuke log. That might also help you figure out what's happening, too. Have you tried adding echo or die statements to isolate errors?

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







PostPosted: Wed Jul 10, 2013 10:43 am Reply with quote

Sorry, I turned error on but I get no error at all. There is no error showing by error.log. This is my index.php

I guess the index.php is too long and it doesn't show properly here.


Last edited by hicuxunicorniobestbuildpc on Wed Jul 10, 2013 4:45 pm; edited 1 time in total 
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1772

PostPosted: Wed Jul 10, 2013 11:19 am Reply with quote

do you have not a larger file with more lines *gg*
[ Only registered users can see links on this board! Get registered or login! ] ftw *gg*

btw in the index is no sql insert - without a insert - no data can be stored *gg*

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







PostPosted: Wed Jul 10, 2013 5:02 pm Reply with quote

These are the 3 files. I didn't include index file from admin neralex. I know there isn't any sql insert but this module works with other old RavenNuke version but not with the new version.
[ Only registered users can see links on this board! Get registered or login! ]
 
nuken
RavenNuke(tm) Development Team



Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Wed Jul 10, 2013 5:21 pm Reply with quote

Two things I noticed is that you have the @ in front of some queries and php functions which will suppress errors. You should remove them so you can find your errors.

Second thing is the file is using mysqli_real_escape_string which should be $db->sql_escape_string.

_________________
Tricked Out News 
View user's profile Send private message Send e-mail Visit poster's website
neralex







PostPosted: Wed Jul 10, 2013 5:23 pm Reply with quote

try to replace the function insert_todb in the functions.php

Code:
function insert_todb($cat, $url_id, $title, $link, $description, $pubdate) {

   global $db, $prefix;
   if (is_numeric($cat) && is_numeric($url_id) && is_numeric($pubdate)) {
      $title = preg_replace('/\n/i','', $title);
      // $nr = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_multiheadlines_news WHERE news_title='$title' AND news_link='$link'"));
      $nr = $db->sql_numrows($db->sql_query('SELECT * FROM `' . $prefix . '_multiheadlines_news` WHERE `news_title` = \'' . $db->sql_escape_string($title) . '\''));
      if (intval($nr)==0) {
         $news_time = time();
         $title = $db->sql_escape_string(htmlspecialchars_decode(check_html($title, 'nohtml'), ENT_QUOTES));
         $link = $db->sql_escape_string(htmlspecialchars_decode(check_html($link, 'nohtml'), ENT_QUOTES));
         $description = $db->sql_escape_string(check_html($description, ''));
         $db->sql_query('INSERT INTO `' . $prefix . '_multiheadlines_news` VALUES '."('$cat', '$url_id', '$title', '$link', '$description', '$pubdate', '$news_time')");
      }
      $db->sql_query('UPDATE `' . $prefix . '_multiheadlines_urls` SET `urls_time` = \'' . time() . '\' WHERE `urls_id` = \'' . $url_id . '\'');
   }
}
 
hicuxunicorniobestbuildpc







PostPosted: Thu Jul 11, 2013 6:06 am Reply with quote

nuken, I replaced all mysqli and I did what neralex suggested. I don't get any news yet. I refresh feeds. I checked log and there is no errors after activated. I checked my log from my cpanel in my server and there is no error. I turned error on and there is no error. I don't know what is going on. It is making crazy this module.


For the moment, there is no news!
 
neralex







PostPosted: Thu Jul 11, 2013 6:14 am Reply with quote

do you get any errors in the dblog file of RN while saving data into the db?
 
hicuxunicorniobestbuildpc







PostPosted: Thu Jul 11, 2013 7:07 am Reply with quote

no, that is the strage thing. I am not getting any error. I checked all tables in phpMyadmin and they are ok. I am having any error.

here i included the index.php frm admin folder
[ Only registered users can see links on this board! Get registered or login! ] Updated

Bang Head Bang Head
 
nuken







PostPosted: Thu Jul 11, 2013 7:40 am Reply with quote

You still have the @ suppressing errors in that file as well as several instances of mysqli_real_escape_string
 
hicuxunicorniobestbuildpc







PostPosted: Thu Jul 11, 2013 7:40 am Reply with quote

I updated right now with a couple of changes.

This is what I did in footer.php

Code:
if (realpath(__FILE__) == realpath($_SERVER['SCRIPT_FILENAME'])) {

   header('Location: index.php');
   exit('Access Denied');
}

global $db;

define('NUKE_FOOTER', true);
   //Multiheadlines module entry
   require( "modules/Multiheadlines/getrss.php" );
foot();


I am not getting any error and the google and yahoo news are not showing.

I changed the log to 2 and I get this error


Code:
July 11, 2013, 1:59 pm

File: /www.bestbuildpc.org/db/mysqli.php - Line: 185
SQL was: SELECT * FROM nuke_modules WHERE title!='Multiheadlines' ORDER BY active DESC, inmenu DESC, custom_title ASC
querycount = 53


Code:
File: /www.bestbuildpc.org/db/mysqli.php - Line: 185

SQL was: SELECT * FROM nuke_multiheadlines_urls WHERE urls_active = '1' AND 1373551193> (urls_time+urls_ref) ORDER BY urls_time ASC LIMIT 0, 1
querycount = 374


Code:
July 11, 2013, 3:59 pm

File: /www.bestbuildpc.org/db/mysqli.php - Line: 185
SQL was: SELECT * FROM nuke_multiheadlines_config
querycount = 369


Code:
July 11, 2013, 3:59 pm

File: /www.bestbuildpc.org/db/mysqli.php - Line: 185
SQL was: SELECT * FROM nuke_multiheadlines_categ WHERE categ_title='News'
querycount = 370


Code:
July 11, 2013, 3:59 pm

File: /www.bestbuildpc.org/db/mysqli.php - Line: 185
SQL was: SELECT * FROM nuke_multiheadlines_news WHERE news_cat='1' AND news_active='1'
querycount = 372
 
kguske







PostPosted: Thu Jul 11, 2013 8:41 pm Reply with quote

Have you tried different themes and disabled all left blocks?
 
hicuxunicorniobestbuildpc







PostPosted: Sat Jul 13, 2013 6:09 pm Reply with quote

Ok guys! After testing a lot in differents ways then I found out where it is coming from the problem. This is the error I get.

Warning: mysql_real_escape_string(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in modules/Multiheadlines/functions.php on line 556

Warning: mysql_real_escape_string(): A link to the server could not be established in /modules/Multiheadlines/functions.php on line 556

Code:
$informations=filtering($info["infos"], $info["encoding"]);

$db->sql_query("UPDATE ".$prefix."_multiheadlines_urls SET urls_infos='".mysql_real_escape_string($informations)."' WHERE urls_id = '".$url_id."'");
return $info;
}


I replace above with . $db->sql_escape_string

Code:
$informations=filtering($info["infos"], $info["encoding"]);

$db->sql_query("UPDATE ".$prefix."_multiheadlines_urls SET urls_infos='". $db->sql_escape_string($informations)."' WHERE urls_id = '".$url_id."'");
return $info;
}


but I didn't get any result Bang Head
 
hicuxunicorniobestbuildpc







PostPosted: Mon Jul 15, 2013 4:43 am Reply with quote

I modify function.php

I replace this one
Code:
if (($contents=file_get_contents($rss)) <> false) {


with

Code:
$ch = curl_init();

curl_setopt ($ch, CURLOPT_URL, $rss);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 25);
$file_contents = curl_exec($ch);
curl_close($ch);
if (($file_contents=='') <> false) {


I don't get any result yet! Sad
 
misterstereus
Regular
Regular



Joined: Aug 03, 2012
Posts: 56
Location: Rome Italy

PostPosted: Mon Jul 15, 2013 10:20 am Reply with quote

Hello hicuxunicorniobestbuildpc can you send me a complete module or link to download? I test to fix it [ Only registered users can see links on this board! Get registered or login! ]
 
View user's profile Send private message Send e-mail Visit poster's website
hicuxunicorniobestbuildpc







PostPosted: Mon Jul 15, 2013 3:59 pm Reply with quote

Here you have the original module without the changes I've been doing.
[ Only registered users can see links on this board! Get registered or login! ]
[ Only registered users can see links on this board! Get registered or login! ]

Im running the first one but anyway none of them work with RavenNuke 2.50 or 2.51.

Sad
 
misterstereus







PostPosted: Tue Jul 16, 2013 9:13 am Reply with quote

Test this beta file if work for you [ Only registered users can see links on this board! Get registered or login! ]
 
hicuxunicorniobestbuildpc







PostPosted: Tue Jul 16, 2013 4:05 pm Reply with quote

No,negative, this one is not working. Remember I am running PHP 5.4
 
hicuxunicorniobestbuildpc







PostPosted: Tue Jul 16, 2013 4:19 pm Reply with quote

Guys I must inform you I fix it myself doing this and I would like to know why neralex's code didn't work.

This is what I did

I search for this function

Code:
function insert_todb($cat, $url_id, $title, $link, $description, $pubdate) {

   global $db, $prefix;
   if (is_numeric($cat) && is_numeric($url_id) && is_numeric($pubdate)) {
      $title = preg_replace('/\n/i','', $title);
      // $nr = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_multiheadlines_news WHERE news_title='$title' AND news_link='$link'"));
      $nr = $db->sql_numrows($db->sql_query('SELECT * FROM `' . $prefix . '_multiheadlines_news` WHERE `news_title` = \'' . $db->sql_escape_string($title) . '\''));
      if (intval($nr)==0) {
         $news_time = time();
         $title = $db->sql_escape_string(htmlspecialchars_decode(check_html($title, 'nohtml'), ENT_QUOTES));
         $link = $db->sql_escape_string(htmlspecialchars_decode(check_html($link, 'nohtml'), ENT_QUOTES));
         $description = $db->sql_escape_string(check_html($description, ''));
         $db->sql_query('INSERT INTO `' . $prefix . '_multiheadlines_news` VALUES '."('$cat', '$url_id', '$title', '$link', '$description', '$pubdate', '$news_time')");
      }
      $db->sql_query('UPDATE `' . $prefix . '_multiheadlines_urls` SET `urls_time` = \'' . time() . '\' WHERE `urls_id` = \'' . $url_id . '\'');
   }
}


I replaced it with this one.

Code:
function insert_todb($cat, $url_id, $title, $link, $description, $pubdate) {

   global $db, $prefix;
   $title=eregi_replace("\n","", $title);
   $title=mysql_escape_string(stripslashes(check_html($title, "nohtml")));
//   $nr = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_multiheadlines_news WHERE news_title='$title' AND news_link='$link'"));
   $nr = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_multiheadlines_news WHERE news_title='$title'"));
   if (intval($nr)==0) {
      $news_time=time();
      $db->sql_query("INSERT INTO ".$prefix."_multiheadlines_news (news_cat, news_site, news_title, news_link, news_description, news_pubdate, news_time) VALUES ('".intval($cat)."', '".intval($url_id)."', '".mysql_escape_string(stripslashes(check_html($title, "nohtml")))."', '".stripslashes(check_html($link, "nohtml"))."', '".mysql_escape_string($description)."', '".intval($pubdate)."', '".intval($news_time)."')");
   }
   $db->sql_query("UPDATE ".$prefix."_multiheadlines_urls SET urls_time='".time()."' WHERE urls_id = '".intval($url_id)."'");
}


and Line 580

Code:
$informations=filtering($info["infos"], $info["encoding"]);

$db->sql_query("UPDATE ".$prefix."_multiheadlines_urls SET urls_infos='".mysql_real_escape_string($informations)."' WHERE urls_id = '".$url_id."'");
return $info;
}


I replace it with this one and now it is working!!!!

Code:
$informations=filtering($info["infos"], $info["encoding"]);

$db->sql_query("UPDATE ".$prefix."_multiheadlines_urls SET urls_infos='".mysql_escape_string($informations)."' WHERE urls_id = '".$url_id."'");
return $info;
}



Very Happy

Thanks anyway misterstereus. I never thought it could be so difficult to fix this module.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> For Hire

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 ©