nukeSEO.com - PHPNuke SEO Search engine optimization, professional tools including nukeSEO, nukeSPAM, nukeFEED, nukePIE, nukeWYSIWYG and more

 

. Welcome to nukeSEO.com  ! 
.
.
.

Tag This



.
nukeSEO.com: Forums


 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Custom RSS Feed Url, $topic, Any Ideas?
 
 
Post new topic   Reply to topic    nukeSEO.com Forum Index -> nukeFEED (tm)
View previous topic :: View next topic  
Author Message
selectric
webmaster


Joined: Aug 26, 2008
Posts: 6

PostPosted: Tue May 05, 2009 10:28 am    Post subject: Custom RSS Feed Url, $topic, Any Ideas? Reply with quote

Hello! Thanks for looking at my post.

In the feed creator includes/nukeSEO/content/News.php near the bottom, the article URL is:

Code:
return getNukeURL().'modules.php?name=News&file=article&sid='.$id;


Where most sites just use the "News" module, I use 3 different custom homemade modules. I have 3 "$topics", and each custom module only posts $sid from their assigned $topic number. However, I use the same generated nukeSEO feed to join them all together. So what I really need is to figure out how to indentify the $topic number, then use it to set up 3 different url's to show in the feed.

So instead of all feed generated urls being modules.php?name=News&file=article&sid=$id OR article-$sid.html, I need the custom url's put in place of these depending on $topic numbers 2, 4 & 5.

Thanks again for everyone who tries to help

Normally I can use something like:
Code:
if ($topic=='2') { 

$url = 'address2';
} else

if ($topic=='4') {
$url = 'address-4';
} else

if ($topic=='5') {
$url = 'address5';
}

echo 'http://www.my_fake-website.com/' .$url. '-' .$sid. '.html


but this isnt working here. The $topic doesnt seem to be identified or something.

This is really important to me that I figure this out.
  
Back to top
View user's profile Send private message
selectric
PostPosted: Tue May 05, 2009 10:30 am    Post subject: Reply with quote

When I try this:

Code:


   }
   function getLink($id, $catid, $topic)
   {
   



////////////////////


  if ($topic=='2') {
$url = '' .$first_baseurl. '-';
} else

if ($topic=='4') {
$url = '' .$second_baseurl. '-';
} else

if ($topic=='5') {
$url = '' .$third_baseurl. '-';
}
//-----------------------------------
/////////////////

 return getNukeURL().'' .$url. '-' .$topic. '' .$id. '.html';
   }
}
?>


The $url doesnt show. Obviously the $topic is not being given?
  
Back to top
Guardian
webmaster


Joined: Dec 25, 2005
Posts: 364
Location: Vsetin, Czech Republic

PostPosted: Wed May 06, 2009 4:09 am    Post subject: Reply with quote

You can just echo the $variables back on the page to see if they have a value assigned to them.
If $topic doesn't have a value then your code falls over immediately so you could check for them like
Code:


if(empty($topic)) {echo 'No topic id found'; }
// as above but for $url

if ($topic=='2') {
$url = '' .$first_baseurl. '-';
} else

if ($topic=='4') {
$url = '' .$second_baseurl. '-';
} else

if ($topic=='5') {
$url = '' .$third_baseurl. '-';
}


It is possible that the functions are not returning the variables because they are not assigned, have been cleared as part of a security routine or are not global.
  
Back to top
View user's profile Send private message
selectric
PostPosted: Wed May 06, 2009 7:26 am    Post subject: Reply with quote

Hi! Thanks for your help!

I tried your suggestion. Ive tried others like it. What happens is, the feed crashes, shows up blank and titled: "Feed code error".

As soon as I try to echo anything, it seems to crash. This code seems to be different from the rest of phpnuke, and I just dont recognize it, so I dont know how to work it.

Stuff like:
Code:
 $this->activeWhere           = '';

      $this->orderArray            = array
                                   (
                                      'recent' => 'recent',
                                      'popular' => 'popular',
                                      'rated' => 'rated'
                                   );
      $this->orderSQLArray         = array
                                   (
                                      'recent' => 'sid DESC',
                                      'popular' => 'counter DESC',
                                      'rated' => 'score DESC'
                                   );
      $this->levelArray            = array
                                   (
                                      'topic' => 'topic',   
                                      'category' => 'category'
                                   );
      $this->levelSQLArray         = array(
                                      'topic' => 'topic',
                                      'category' => 'catid',

                                   );


Im assuming that this file includes/nukeSEO/content/News.php is not the output file, but rather is sending the story id to another file gernerator, and that is why I cannot echo anything?

Almost anywhere else on phpnuke I could simply use my code to determine the url based upon the $topic, but not here. And I really need thist to work.....

Anyone else have any ideas? Files I should try, mess around with?
Thanks again for any help or suggestions.
  
Back to top
selectric
PostPosted: Wed May 06, 2009 7:29 am    Post subject: Reply with quote

This line a bit higher:

Code:
   }

   function getLink($id, $catid, $topic)
   {


gives the $id. I added the $topic to it, but it still doesnt give the topic. Im assuming I need to find this "getLink" function, but I dont know where it is. It's not in this paticular file.
  
Back to top
selectric
PostPosted: Wed May 06, 2009 8:04 am    Post subject: Reply with quote

Got it. I had some special help!
In includes/nukeSEO/content/News.php,
above my special code, I had to call in the topic based upon the $id. I still dont know how this "$id" is getting created, especially since _stories gives a $sid...

I added topic all around this file, mimmicking everywhere similar items were being placed.

I also put this above my special code:
Code:
   global $db, $prefix;

   $res = $db->sql_query('SELECT topic FROM '.$prefix.'_stories WHERE sid="'.$id.'" LIMIT 1;');
   $res = $db->sql_fetchrow($res);
$topic = $res['topic'];
$topic = intval($topic);


Thanks again for your help!
  
Back to top
Display posts from previous:       
Post new topic   Reply to topic    nukeSEO.com Forum Index -> nukeFEED (tm) All times are GMT - 5 Hours
 
 Page 1 of 1

 

Jump to:   
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 cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001-2008 phpBB Group


Page Generation: 0.14 Seconds