Accessing news module article title in user defined tag

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
lampsie
Forum Members
Forum Members
Posts: 38
Joined: Fri Nov 17, 2006 9:25 am

Accessing news module article title in user defined tag

Post by lampsie »

Hi guys,

Having a lot of trouble trying to get my head around this, so any assistance you might have would be greatly appreciated!

I am implementing a third party rate-this-article tool to the news section on my site, however I am having trouble accessing the news article title from my user defined tag (need to do this so I can write the article title and its rating to a flat file). The following does not work (no errors, just outputs blank string), could anyone let me know where I am going wrong?

Code: Select all

global $gCms;
$module =& $gCms->modules['News']['object'];
$ratingtitle= $module->news_title;
echo show_rating($ratingtitle,5);
Thanks,
lampsie
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Accessing news module article title in user defined tag

Post by RonnyK »

Have you tried this logic to pull the news_title:

http://forum.cmsmadesimple.org/index.ph ... l#msg50175

Ronny
lampsie
Forum Members
Forum Members
Posts: 38
Joined: Fri Nov 17, 2006 9:25 am

Re: Accessing news module article title in user defined tag

Post by lampsie »

Hi Ronny,

Thx for suggestion - yup that was my main logic source (as per the code I have in the tag) - tried following it exactly, but it didn't seem to help me :(
PS I'm on CMSMS 1.0.4

A
lampsie
Forum Members
Forum Members
Posts: 38
Joined: Fri Nov 17, 2006 9:25 am

Re: Accessing news module article title in user defined tag

Post by lampsie »

Success!

Thanks ronny - your post prompted me to re-follow the steps again, and I spotted where I went wrong:

I had:
$this->title = $row['news_title'];

Should have been...
$this->news_title = $row['news_title'];

in news.action.php

Many thanks!
Lampsie
lampsie
Forum Members
Forum Members
Posts: 38
Joined: Fri Nov 17, 2006 9:25 am

Re: Accessing news module article title in user defined tag

Post by lampsie »

Hi guys,

Following on from my attempt to get rank-this-page third party php script working, I'm now a little stuck with AJAX posting from within the script...

The post action, after following the above, replaces ampersands with "&" in the query string, which the receiving script then cannot understand.

How do I prevent User Defined Tags etc. from parsing ampersand symbols?

Thanks,
lampsie
Post Reply

Return to “CMSMS Core”