PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
selectric
Regular
Regular


Joined: Aug 06, 2008
Posts: 65

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

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().'article.html'.$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: 268
Location: Missouri

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

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


Joined: Aug 06, 2008
Posts: 65

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

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


Sorry, I dont understand what you mean?
View user's profile Send private message
horrorcode
Involved
Involved


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

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

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...
View user's profile Send private message Visit poster's website MSN Messenger
selectric
Regular
Regular


Joined: Aug 06, 2008
Posts: 65

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

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.
View user's profile Send private message
selectric
Regular
Regular


Joined: Aug 06, 2008
Posts: 65

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

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.
View user's profile Send private message
selectric
Regular
Regular


Joined: Aug 06, 2008
Posts: 65

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

I just realized that the "Tap" function is apparently changing my code
return getNukeURL().'article.html'.$id;
View user's profile Send private message
selectric
Regular
Regular


Joined: Aug 06, 2008
Posts: 65

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

return getNukeURL().'modules.php?name= News &file= article &sid='.$id;
View user's profile Send private message
selectric
Regular
Regular


Joined: Aug 06, 2008
Posts: 65

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

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.
View user's profile Send private message
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 6044

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

First, what is custom about your site? The news URL isn't standard? Can you give some examples of how it was customized?
View user's profile Send private message
selectric
Regular
Regular


Joined: Aug 06, 2008
Posts: 65

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

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.
View user's profile Send private message
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 6044

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

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?
View user's profile Send private message
selectric
Regular
Regular


Joined: Aug 06, 2008
Posts: 65

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

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.
View user's profile Send private message
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 6044

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

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.
View user's profile Send private message
selectric
Regular
Regular


Joined: Aug 06, 2008
Posts: 65

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

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!
View user's profile Send private message
selectric
Regular
Regular


Joined: Aug 06, 2008
Posts: 65

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

Hi! Please remember this request, it's very important to me that I figure out this issue. Thanks for any help.
View user's profile Send private message
selectric
Regular
Regular


Joined: Aug 06, 2008
Posts: 65

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

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.
View user's profile Send private message
selectric
Regular
Regular


Joined: Aug 06, 2008
Posts: 65

PostPosted: Wed May 06, 2009 7:05 am Reply with quote Back to top

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!
View user's profile Send private message
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 6044

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

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...
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum