Fiji Web Design
Welcome, Guest
Please Login or Register.    Lost Password?
How to add additional text (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: How to add additional text
#520
p0oo9ip0o (User)
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
How to add additional text 3 Years, 1 Month ago Karma: 0  
I want to have a plugin that will add a customized text on the article,

for example I add {additionalinfo} at the bottom of the article, there will be a sentence at the bottom

"[title of the current article] is a part of the [title of the Category of the current article]"

the [title of the current article] and the [title of the Category of the current article] are text link

is it possible?
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#536
admin (Admin)
Admin
Posts: 475
graph
User Online Now Click here to see the profile of this user
Re:How to add additional text 3 Years, 1 Month ago Karma: 10  
To add any additional text, you would just append it to $row->text in Joomla1.0 or to $article->text in Joomla1.5.

Eg:

$article->text .= ' your custom text ';
Is this what you want?
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#540
p0oo9ip0o (User)
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
Re:How to add additional text 3 Years, 1 Month ago Karma: 0  
may that's it but how do i put the customized text by just adding {additionaltext} on the article?
 
Report to moderator   Logged Logged  
 
Last Edit: 2009/01/03 01:53 By p0oo9ip0o.
  The administrator has disabled public write access.
#541
admin (Admin)
Admin
Posts: 475
graph
User Online Now Click here to see the profile of this user
Re:How to add additional text 3 Years, 1 Month ago Karma: 10  
Try:
$custom_text = ' your custom text '; // your custom text
$article->text = str_replace('{additionaltext}', $custom_text, $article->text);
This will replace any instances of {additionaltext} with your $custom_text;
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#542
p0oo9ip0o (User)
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
Re:How to add additional text 3 Years, 1 Month ago Karma: 0  
where should i put that code?

/public_html/?????

and also how do I add the title of the current article and category to my custom text?
for example

$custom_text = ' this *title of current article* is belongs to *title of category*';
 
Report to moderator   Logged Logged  
 
Last Edit: 2009/01/03 05:54 By p0oo9ip0o.
  The administrator has disabled public write access.
#544
admin (Admin)
Admin
Posts: 475
graph
User Online Now Click here to see the profile of this user
Re:How to add additional text 3 Years, 1 Month ago Karma: 10  
Place the code in the plugin parameters, under the "onprepare" content event field.

The title is $article->title and the category would be $article->cat I believe.
You have to add those to your $custom_text variable.

eg:

$custom_text = 'this '.$article->title.' belongs to '.$article->cat;
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Joomla Downloads

DownloadsDownload our free Joomla! Components, Modules and Plugins.