Author |
Message |
selectric
Regular
![Regular Regular](modules/Forums/images/ranks/2stars.gif)
![](modules/Forums/images/avatars/Winnie_The_Pooh/Winnie_The_Pooh_-_Pooh.gif)
Joined: Aug 06, 2008
Posts: 65
|
Posted:
Sun Apr 12, 2009 2:39 pm |
|
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 |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
horrorcode
Involved
![Involved Involved](modules/Forums/images/ranks/4stars.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Jan 17, 2009
Posts: 272
Location: Missouri
|
Posted:
Sun Apr 12, 2009 4:00 pm |
|
Just guessing but maybe you can change "$id" to "$sid" or vise versa? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
selectric
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Apr 12, 2009 4:11 pm |
|
horrorcode wrote: | Just guessing but maybe you can change "$id" to "$sid" or vise versa? |
Sorry, I dont understand what you mean? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
horrorcode
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Apr 12, 2009 7:17 pm |
|
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... |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
selectric
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Apr 13, 2009 8:37 am |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
selectric
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Apr 20, 2009 11:40 am |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
selectric
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Apr 20, 2009 11:45 am |
|
I just realized that the "Tap" function is apparently changing my code
return getNukeURL().'modules.php?name=News&file=article&sid='.$id; |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
selectric
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Apr 20, 2009 11:45 am |
|
return getNukeURL().'modules.php?name= News &file= article &sid='.$id; |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
selectric
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Apr 20, 2009 11:46 am |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
kguske
Site Admin
![](modules/Forums/images/avatars/41f0b40a419280935f3a0.gif)
Joined: Jun 04, 2004
Posts: 6437
|
Posted:
Mon Apr 20, 2009 11:56 am |
|
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...
Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
selectric
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Apr 20, 2009 12:25 pm |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
kguske
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Apr 20, 2009 1:05 pm |
|
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? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
selectric
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Apr 20, 2009 1:24 pm |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
kguske
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Apr 20, 2009 2:01 pm |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
selectric
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Apr 20, 2009 2:23 pm |
|
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! |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
selectric
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Apr 30, 2009 4:01 pm |
|
Hi! Please remember this request, it's very important to me that I figure out this issue. Thanks for any help. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
selectric
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue May 05, 2009 9:19 am |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
selectric
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed May 06, 2009 7:05 am |
|
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! |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
kguske
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed May 06, 2009 10:11 pm |
|
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... |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|