Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> nukeFeed/FeedCreator
Author Message
selectric
Regular
Regular



Joined: Aug 06, 2008
Posts: 65

PostPosted: Sun Apr 12, 2009 2:39 pm Reply with quote

Hello and thank you for your time!

In my custom site, I have different URL's for stories, based upon what Topic they have. For the normal sections of my website, I use the following to manipulate what url to publish:

Code:
if ($topic=='2') {

$url = 'address2';
} else

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

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

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


Now 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;


My custom URL manipulator does not work in this file, it doesnt appear to be written in regular PHP-Nuke style coding..

Can anyone please advise me on how to set the url based upon the topic, for this news feed creator? Thank you!


Last edited by selectric on Mon Apr 20, 2009 11:44 am; edited 1 time in total 
View user's profile Send private message
horrorcode
Involved
Involved



Joined: Jan 17, 2009
Posts: 272
Location: Missouri

PostPosted: Sun Apr 12, 2009 4:00 pm Reply with quote

Just guessing but maybe you can change "$id" to "$sid" or vise versa?
 
View user's profile Send private message
selectric







PostPosted: Sun Apr 12, 2009 4:11 pm Reply with quote

horrorcode wrote:
Just guessing but maybe you can change "$id" to "$sid" or vise versa?


Sorry, I dont understand what you mean?
 
horrorcode







PostPosted: Sun Apr 12, 2009 7:17 pm Reply with quote

Sorry for not explaining myself better, but this is just a guess.

Assuming return basically echos the content, you could try replacing:

Code:


return getNukeURL().'article.html'.$id;


with:

Code:


if ($topic=='2') {
$url = 'address2';
} else

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

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

echo 'http://www.my--website.com/' .$url. '-' .$id. '.'article.html'.


Dont know if it would work, just thinking since it uses sid instead of id that could be part of the problem but that formatting with those outer periods is confusing to me...
 
selectric







PostPosted: Mon Apr 13, 2009 8:37 am Reply with quote

Thanks, I will give it a try and report back.. As I mentioned, this paticular file doesnt seem to be written in regular php-nuke style coding. I dont understand it. I also dont know how to get the topic instated, to use in the first place. Im trying.
 
selectric







PostPosted: Mon Apr 20, 2009 11:40 am Reply with quote

I just keep messing around with this and cant seem to get it. Does anyone know how to do this?

includes/nukeSEO/content/News.php

It seems like it should be simple, however it's just not working.

All I need is to customize the feed url conditional on it's given _stories $topic number.

Code:


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





  if ($topic=='2') {
$url = 'featured-articles-';
} else

if ($topic=='3') {
$url = 'more-content-';
} else

if ($topic=='4') {
$url = 'the-archives';
}

// HOW DO I WORK THE ' .$url. ' HERE?

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


Part of the problem is that it apparently isnt giving me the $topic number to work with. When I try to use an sql query, it voids out the whole rss feed.
 
selectric







PostPosted: Mon Apr 20, 2009 11:45 am Reply with quote

I just realized that the "Tap" function is apparently changing my code
return getNukeURL().'modules.php?name=News&file=article&sid='.$id;
 
selectric







PostPosted: Mon Apr 20, 2009 11:45 am Reply with quote

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







PostPosted: Mon Apr 20, 2009 11:46 am Reply with quote

There we go. That posted. Now I need the "News" to change to different module names based upon what topic number the sid has. Thanks for your time.
 
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6432

PostPosted: Mon Apr 20, 2009 11:56 am Reply with quote

First, what is custom about your site? The news URL isn't standard? Can you give some examples of how it was customized?

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







PostPosted: Mon Apr 20, 2009 12:25 pm Reply with quote

Hi, thanks for responding!

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 /article-$sid.html, I need the custom url's put in place of the "article-$sid.html" or modules.php?name=News&......$sid depending on $topic numbers 2, 4 & 5.

Thanks again for everyone who has tried 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.mywebsite.com/' .$url. '-' .$sid. '.html


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







PostPosted: Mon Apr 20, 2009 1:05 pm Reply with quote

It sounds like there should be a custom Feed type for the custom module(s). Or are you trying to include links to the topics in the News feed?

Are the custom modules only for topics 2, 4 and 5?
 
selectric







PostPosted: Mon Apr 20, 2009 1:24 pm Reply with quote

kguske wrote:
It sounds like there should be a custom Feed type for the custom module(s). Or are you trying to include links to the topics in the News feed?

Are the custom modules only for topics 2, 4 and 5?


Hi, Yes I only have custom modules for topics 2, 4 and 5. I use the regular news posting administration, I only post in these 3 topics, and each of the custom modules only show stories with their assigned topic. So when I use the RavenNuke built in RSS feed generator, all the stories show up together. I just want to make each RSS item link go to it's specific URL depending on which of the 3 topics the associated $sid has. It's so simple anywhere else on the site, but this feed php coding is different, or more complex than what Im use to.

I definately want all of my "News" posts together on the same News RSS feed. I just need to change that work article in "article-$sid.html depending on the $topic. For example, topic 5 could be for posts under the url: website.com/health-$sid.html. So if it's a topic 5 story, switch RSS feed link to health: health-$sid.html......

Thanks again.
 
kguske







PostPosted: Mon Apr 20, 2009 2:01 pm Reply with quote

That isn't how the Feeds module was designed, but because it uses object oriented code, the functions that assign the module / link can be overridden.

I will look at this when I have some time and provide an example.
 
selectric







PostPosted: Mon Apr 20, 2009 2:23 pm Reply with quote

kguske wrote:
That isn't how the Feeds module was designed, but because it uses object oriented code, the functions that assign the module / link can be overridden.

I will look at this when I have some time and provide an example.


That's great thanks!
 
selectric







PostPosted: Thu Apr 30, 2009 4:01 pm Reply with quote

Hi! Please remember this request, it's very important to me that I figure out this issue. Thanks for any help.
 
selectric







PostPosted: Tue May 05, 2009 9:19 am Reply with quote

Does anyone know how to retreive the $topic? It gives the $sid, but I can't get it to give me the $topic per story.
 
selectric







PostPosted: Wed May 06, 2009 7:05 am 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!
 
kguske







PostPosted: Wed May 06, 2009 10:11 pm Reply with quote

Not much help really (and sorry for that - as Raven can tell you, I'm way behind). After the air clears on several projects, I'll explain why the $id worked...
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> nukeFeed/FeedCreator

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 ©