Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
dean
Worker
Worker



Joined: Apr 14, 2004
Posts: 193

PostPosted: Tue Aug 31, 2004 3:50 pm Reply with quote

I'm using the Syndication Module, similar to Easy News module on my site at Only registered users can see links on this board! Get registered or login!, a site that is phpnuke 7.3, patched to 2.5 and includes Sentinel 2.01. I have had no problems with backend feeds, ie backend.php, rdf-nuke.php or backendforums.php. Each provide good feeds to a few users interested in my sites news.

In fact the Syndication module does a reliable job of feeding the news from the site as well and provides users with easy script to place the feed on a regular html site. Unfortunately, the images are not showing up on sites using the feed. They present well on my site but somehow in the feed, the url of the image isnt being passed correctly.

Here's the code from the index file:
Code:
<?

/**********************************************************************/
/* Syndication for phpNuke v6.0                                       */
/* Modified from/based on EasyNews for phpNuke 4.1                    */
/* by Pascal (extanfr@ifrance.com)                                    */
/* Modified by wesley@queeries.net                                    */
/* http://dev.queeries.net                                            */       
/**********************************************************************/

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

$index = 1;   
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);


/* OPTIONS  */
$easy_name_rep            = "Syndication";        /* module folder name */
$tb_stories               = $prefix."_stories";
$tb_topics                 = $prefix."_topics";


/* News Box */
$easy_color_top_box          = "9999ff";
$easy_color_body_box      = "FFFFFF";
$easy_color_border_box      = "000000";
$easy_color_topic_box      = "FF0000";
$easy_color_title_box      = "000000";
$easy_color_date_box      = "FF0000";
$easy_color_sitename_box   = "000000";
$easy_widht_box             = 500;            
$easy_num_news_box           = 5;            /* 5 news if ac2=0 */
$easy_topic_box             = 0;            /* 0 all topics if ac3=0  */
$easy_gif_box              = "sb.gif";        /* 75x20 */


/* News */
$easy_color_top_news      = "9999ff";
$easy_color_body_news      = "FFFFFF";
$easy_color_border_news      = "000000";
$easy_color_foot_news      = "000000";
$easy_color_topic_news      = "FF0000";
$easy_color_date_news      = "FF0000";
$easy_color_sitename_news   = "000000";
$easy_widht_news          = 144;            
$easy_num_news_news          = 5;            /* 5 news if ac2=0 */
$easy_topic_news          = 0;            /* 0 all topics if ac3=0 */
$easy_gif_news             = "sn.gif";       /* 150x20 */


/* Title */
$easy_color_top_title      = "9999ff";
$easy_color_body_title      = "FFFFFF";
$easy_color_border_title   = "000000";
$easy_color_foot_title      = "000000";
$easy_color_topic_title      = "FF0000";
$easy_color_date_title      = "FF0000";
$easy_color_sitename_title   = "000000";
$easy_widht_title          = 150;            
$easy_num_news_title      = 5;            /* 5 news if ac2=0 */
$easy_topic_title          = 0;            /* 0 all topics if ac3=0 */
$easy_gif_title             = "sn.gif";        /* 150x20 */

/* Scroller */
$easy_color_top_scroll      = "9999ff";
$easy_color_body_scroll      = "FFFFFF";
$easy_color_border_scroll   = "000000";
$easy_color_foot_scroll      = "000000";
$easy_color_topic_scroll   = "FF0000";
$easy_color_date_scroll      = "FF0000";
$easy_color_sitename_scroll   = "000000";
$easy_widht_scroll         = 150;
$easy_height_scroll       = 150;            
$easy_num_news_scroll      = 5;            /* 5 news if ac2=0 */
$easy_topic_scroll        = 0;            /* 0 all topics if ac3=0 */
$easy_gif_scroll          = "ss.gif";         /* 150x150 */



/********************************************************************/


$supcri="";// si topic
$easymod = "op=modload&name=$easy_name_rep&file=index";



function easy_jscript($jslo)
{
   echo sprintf ("%s%s%s", "document.write('",$jslo,"');")."\n";
}

function easy_clean($hometext,$lg)
{
   $hometext = ereg_replace("<[^>]*>", "", $hometext);
   $hometext = ereg_replace(13, " ", $hometext);
   $hometext = ereg_replace(10, " ", $hometext);
   $hometext = substr($hometext,0,$lg);
   $hometext = chop(ereg_replace("'", "\'",$hometext));
   $hometext.=" ...";
   
   return($hometext);
}

function easy_modhtml()
{
global $easy_name_rep, $nukeurl, $easymod, $dbname, $tb_topics, $sitename, $slogan;
   
/* Insert in easy_html.php your html code to present headlines */
   
   $linknewsbox=$nukeurl."/modules.php?".$easymod."&ac=news&ac2=&ac3=";
   $linkboxbox=$nukeurl."/modules.php?".$easymod."&ac=box&ac2=&ac3=";
   $linktitlebox=$nukeurl."/modules.php?".$easymod."&ac=title&ac2=&ac3=";
   $linkscroller=$nukeurl."/modules.php?".$easymod."&ac=scroller&ac2=&ac3=";
   
   $easyurl =$nukeurl."/modules.php?".$easymod."&ac=";

   $easytopic="";
   $result= mysql_db_query($dbname,"select topicid,topictext from $tb_topics");   
   while(list($topicid,$topictext)=mysql_fetch_row($result))
   {
   $easytopic.="<OPTION VALUE=\"$topicid\"> $topictext\n";
   }
   
   include("modules/$easy_name_rep/html.php");
   
}

function easy_make_date($time)
{
   ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $time, $day);
   $date = $day[3].'/'.$day[2].'/'.$day[1];
   return($date);
}

switch($ac) {

   case news :
   
   if ($ac3!=0)
   {
   $supcri="and $tb_stories.topic=".$ac3;
   }else{
      if ($easy_topic_box == 0)
      {
      $supcri="";
      }else{
      $supcri="and $tb_stories.topic=".$easy_topic_news;
      }
   }
   
   if ($ac2==0){$ac2=$easy_num_news_news;}
   
   
   $easy_widht_news-=4;
   easy_jscript("<TABLE WIDTH=".$easy_widht_news." BORDER=1 CELLSPACING=0 cellpadding=2 bordercolor=".$easy_color_border_news.">");
   easy_jscript("<TR><TD BGCOLOR=".$easy_color_top_news." bordercolor=".$easy_color_top_news."><FONT FACE=Verdana SIZE=2 COLOR=".$easy_color_sitename_news."><CENTER><B>$sitename</B><CENTER></FONT></TD></TR>");
   easy_jscript("<TR><TD bgcolor=".$easy_color_body_news." bordercolor=".$easy_color_body_news.">");
      
   $result = mysql_db_query($dbname,"SELECT $tb_stories.sid, $tb_stories.title, $tb_stories.time, $tb_stories.hometext, $tb_topics.topictext FROM $tb_stories,$tb_topics where $tb_topics.topicid=$tb_stories.topic $supcri ORDER BY $tb_stories.sid DESC limit $ac2");
   while(list($sid,$title,$time,$hometext,$topictext) = mysql_fetch_row($result))
   {       
   
   $title= chop(ereg_replace("'", "\'",$title));
   $text=easy_clean($hometext,100);
   $topictext= ucfirst(chop(ereg_replace("'", "\'",$topictext)));
   $date_news=easy_make_date($time);
   
   easy_jscript("<font FACE=Verdana size=\"1\" color=\"".$easy_color_topic_news."\"><b>".$topictext."</b> :</font>");
   easy_jscript("<font FACE=Verdana size=\"1\" color=\"".$easy_color_date_news."\">".$date_news."</font>");
   easy_jscript("<br><a href=\"".$nukeurl."/modules.php?name=News&file=article&sid=".$sid."\" target=\"_blank\"><font size=1 face=Verdana ><b>".$text."</b></font></a><br><br>");
   }
   easy_jscript("</td></tr><tr><td BGCOLOR=".$easy_color_foot_news." bordercolor=".$easy_color_foot_news.">");
   easy_jscript("<center><b><a href=".$nukeurl."/modules.php?".$easymod."&ac=add target=_blank><img src=\"$nukeurl/modules/".$easy_name_rep."/images/".$easy_gif_news."\" border==0></a></center>");   
   easy_jscript("</FONT></td></tr></table>");
   
   break;


   case box :
   
   if ($ac3!=0)
   {
   $supcri="and $tb_stories.topic=".$ac3;
   }else{
      if ($easy_topic_box == 0)
      {
      $supcri="";
      }else{
      $supcri="and $tb_stories.topic=".$easy_topic_box;
      }
   }
   
   if ($ac2==0){$ac2=$easy_num_news_box;}
   
   easy_jscript("<TABLE WIDTH=".$easy_widht_box." BORDER=0 CELLSPACING=0 cellpadding=0 ><TR>");
   easy_jscript("<td><a href=".$nukeurl."/modules.php?".$easymod."&ac=add target=_blank><img src=\"$nukeurl/modules/".$easy_name_rep."/images/".$easy_gif_box."\" border=0></a></td>");
   easy_jscript("<TD width=100% BGCOLOR=".$easy_color_top_box."><FONT FACE=Verdana SIZE=2 COLOR=".$easy_color_sitename_box."><CENTER><B>".$sitename.":&nbsp;".$slogan."</B></CENTER></FONT></TD></TR>");
   easy_jscript("<TR><TD colspan=2>");
   easy_jscript("<table WIDTH=100% BORDER=1 CELLSPACING=1 cellpadding=3 bgcolor=".$easy_color_body_box." bordercolor=".$easy_color_border_box.">");
   easy_jscript("<TR><TD bgcolor=".$easy_color_body_box." bordercolor=".$easy_color_body_box.">");
      
   $result = mysql_db_query($dbname,"SELECT $tb_stories.sid, $tb_stories.title, $tb_stories.time, $tb_stories.hometext, $tb_topics.topictext FROM $tb_stories,$tb_topics where $tb_topics.topicid=$tb_stories.topic $supcri ORDER BY $tb_stories.sid DESC limit $ac2");
   while(list($sid,$title,$time,$hometext,$topictext) = mysql_fetch_row($result))
   {       
   
   $title= ucfirst(chop(ereg_replace("'", "\'",$title)));
   $text=easy_clean($hometext,300);
   $topictext= ucfirst(chop(ereg_replace("'", "\'",$topictext)));
   $date_news=easy_make_date($time);
   
   easy_jscript("<font FACE=Verdana size=\"2\" color=\"".$easy_color_topic_box."\"><b>".$topictext."</b> :</font>");
   easy_jscript("<font FACE=Verdana size=\"1\" color=\"".$easy_color_date_box."\">".$date_news."</font>");
   easy_jscript("<br><font FACE=Verdana size=\"2\" color=\"".$easy_color_title_box."\"><b>".$title."</b></font><br>");
   easy_jscript("<a href=\"".$nukeurl."/modules.php?name=News&file=article&sid=".$sid."\" target=\"_blank\"><font size=1 face=Verdana ><b>".$text."</b></font></a></font><br><br>");
   }
   easy_jscript("</td></tr></table>");
   easy_jscript("</td></tr></table>");
   break;
   
   case title :
   
   if ($ac3!=0)
   {
   $supcri="and $tb_stories.topic=".$ac3;
   }else{
      if ($easy_topic_title == 0)
      {
      $supcri="";
      }else{
      $supcri="and $tb_stories.topic=".$easy_topic_title;
      }
   }
   
   if ($ac2==0){$ac2=$easy_num_news_title;}
   
   
   $easy_widht_title-=4;
   easy_jscript("<TABLE WIDTH=".$easy_widht_title." BORDER=1 CELLSPACING=0 cellpadding=2 bordercolor=".$easy_color_border_title.">");
   easy_jscript("<TR><TD BGCOLOR=".$easy_color_top_title." bordercolor=".$easy_color_top_title."><FONT FACE=Verdana SIZE=2 COLOR=".$easy_color_sitename_title."><CENTER><B>$sitename</B></CENTER></FONT></TD></TR>");
   easy_jscript("<TR><TD bgcolor=".$easy_color_body_title." bordercolor=".$easy_color_body_title.">");
      
   $result = mysql_db_query($dbname,"SELECT $tb_stories.sid, $tb_stories.title, $tb_stories.time, $tb_stories.hometext, $tb_topics.topictext FROM $tb_stories,$tb_topics where $tb_topics.topicid=$tb_stories.topic $supcri ORDER BY $tb_stories.sid DESC limit $ac2");
   while(list($sid,$title,$time,$hometext,$topictext) = mysql_fetch_row($result))
   {       
   
   $title= chop(ereg_replace("'", "\'",$title));
   $topictext= ucfirst(chop(ereg_replace("'", "\'",$topictext)));
   $date_news=easy_make_date($time);
   
   easy_jscript("<font FACE=Verdana size=\"1\" color=\"".$easy_color_topic_title."\"><b>".$topictext."</b> :</font>");
   easy_jscript("<font FACE=Verdana size=\"1\" color=\"".$easy_color_date_title."\">".$date_news."</font>");
   easy_jscript("<br><a href=\"".$nukeurl."/modules.php?name=News&file=article&sid=".$sid."\" target=\"_blank\"><font size=1 face=Verdana ><b>".$title."</b></font></a><br><br>");
   }
   easy_jscript("</td></tr><tr><td BGCOLOR=".$easy_color_foot_title." bordercolor=".$easy_color_foot_title.">");
   easy_jscript("<center><b><a href=".$nukeurl."/modules.php?".$easymod."&ac=add target=_blank><img src=\"$nukeurl/modules/".$easy_name_rep."/images/".$easy_gif_title."\" border==0></a></center>");
   easy_jscript("</FONT></td></tr></table>");
   break;
   
   
   case scroller:
   
   if ($ac3!=0)
   {
   $supcri="and $tb_stories.topic=".$ac3;
   }else{
      if ($easy_topic_scroll == 0)
      {
      $supcri="";
      }else{
      $supcri="and $tb_stories.topic=".$easy_topic_scroll;
      }
   }
   
   if ($ac2==0){$ac2=$easy_num_news_scroll;}
   if ($ac2<2){$ac2=2;}
   
   easy_jscript("<TABLE WIDTH=".$easy_widht_scroll." BORDER=1 CELLSPACING=0 cellpadding=2 bordercolor=".$easy_color_border_scroll.">");
   easy_jscript("<TR><TD BGCOLOR=".$easy_color_top_scroll." bordercolor=".$easy_color_top_scroll."><FONT FACE=Verdana SIZE=2 COLOR=".$easy_color_sitename_scroll."><CENTER><B>$sitename</B><CENTER></FONT></TD></TR>");
   easy_jscript("<TR><TD bgcolor=".$easy_color_body_scroll." bordercolor=".$easy_color_body_scroll.">");
   
   echo "var scrollerwidth=$easy_widht_scroll\n";
   echo "var scrollerheight=$easy_height_scroll\n";
   echo "var scrollerbgcolor='$easy_color_body_scroll'\n";
   echo "var messages=new Array();\n";
   
   $z=0;   
   $result = mysql_db_query($dbname,"SELECT $tb_stories.sid, $tb_stories.title, $tb_stories.time, $tb_stories.hometext, $tb_topics.topictext FROM $tb_stories,$tb_topics where $tb_topics.topicid=$tb_stories.topic $supcri ORDER BY $tb_stories.sid DESC limit $ac2");
   while(list($sid,$title,$time,$hometext,$topictext) = mysql_fetch_row($result))
   {       
   
   $title= chop(ereg_replace("'", "\'",$title));
   $text=easy_clean($hometext,200);
   $topictext= ucfirst(chop(ereg_replace("'", "\'",$topictext)));
   $date_news=easy_make_date($time);
   
   echo "messages[".$z."]='<font FACE=Verdana size=\"1\" color=\"".$easy_color_topic_scroll."\"><b>".$topictext."</b> :</font><font FACE=Verdana size=\"1\" color=\"".$easy_color_date_scroll."\">".$date_news."</font><br><a href=\"".$nukeurl."/modules.php?name=News&file=article&sid=".$sid."\" target=\"_blank\"><font face=vedana size=1><b>$text</b></font></a>';\n";
   $z++;
   }
   echo "messages[".$z."]='<center><a href=".$nukeurl."/modules.php?".$easymod."&ac=add target=_blank><img src=\"$nukeurl/modules/".$easy_name_rep."/images/".$easy_gif_scroll."\" border=0></a></center>';\n";   
   include("modules/".$easy_name_rep."/syndication.js");
   easy_jscript("</td></tr></table>");
   
   break;
      
   
   case add:
   default:
   include("header.php");
   OpenTable();
   easy_modhtml();
   CloseTable();   
   include("footer.php");
   
   break;
        break;

}
?>


Not sure how to correct this and my diagnoses may be wrong too. Any thoughts out there?


Last edited by dean on Tue Aug 31, 2004 11:49 pm; edited 1 time in total 
View user's profile Send private message
sixonetonoffun
Spouse Contemplates Divorce



Joined: Jan 02, 2003
Posts: 2496

PostPosted: Tue Aug 31, 2004 5:47 pm Reply with quote

The images will only show in readers/blocks that are allowing them. PHPNuke doesn't you could make a block that would and offer it to you visitors too.

PostNuke users have the option with the default RSS block to turn them on or off. This topic has been pretty heavily done here this week. The conclusion is since its such a core feature any update to the readers should really come from phpnuke.org

Outside of third party modules and blocks.

_________________
[b][size=5]openSUSE 11.4-x86 | Linux 2.6.37.1-1.2desktop i686 | KDE: 4.6.41>=4.7 | XFCE 4.8 | AMD Athlon(tm) XP 3000+ | MSI K7N2 Delta-L | 3GB Black Diamond DDR
| GeForce 6200@433Mhz 512MB | Xorg 1.9.3 | NVIDIA 270.30[/size:2b8 
View user's profile Send private message
sixonetonoffun







PostPosted: Tue Aug 31, 2004 5:50 pm Reply with quote

Sorry I mis read your post. The image path is set by $nukeurl you will have to tweak the output path and add whatever is missing. Or change your preferences for Nuke Url to match the modules needs.

Trouble is some mods are coded with a a slash some without.
 
dean







PostPosted: Tue Aug 31, 2004 11:51 pm Reply with quote

Naw, that doesnt make sense. The images are being passed to the module and the syndicated news images have the same path. Now I'm wondering if it's the module or some characteristic of my web server.
 
sixonetonoffun







PostPosted: Wed Sep 01, 2004 6:02 am Reply with quote

The other thing is if you have hotlinking blocked but that would be really obvious.

You could put the java code in a blank html file and open it in your browser and view source on it to verify image path and name. Actually that just shows the .js file but if you open it in IE it should show the image or a red X you can right click on that and view properties. Mine shows nukeurl/modules/Syndication/images/ss.gif
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> 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 ©