flynryan692 Posted June 2, 2010 Report Posted June 2, 2010 Ok, so on my frontpage I have a column for each thing like new pilots, pirep and news, now the news is setup to only show the first few sentences of the story then I have a read more link...what I want to do is limit the number of characters that are shown, then I want the full story to be in another file. I'm guessing I'll need to edit the news_newsitem.tpl file to only show x amount of letters and what not then make a new .tpl file to have the full story in. So, here is my question, how do I limit the characters..like the php..I'm a php n00b.. How do I echo the link to the full story..I'm guessing each news story has an id in the database..? Php is so confusing...sorry.. Thanks. Quote
Administrators simpilot Posted June 5, 2010 Administrators Report Posted June 5, 2010 You can limit the number of characters returned in a string using substr substr($data,0,100) would return the characters from position 0 to position 100 in the $data string. To echo a link to your news item you could add $this->set('id', $row->id); on the blank line 46 in news.php in root/core/modules/news then in your template echo it out something like echo '<a href="'.url(my_custom_news).'/'.$id.'">Click For Full Story</a> That would point to a module you have built "my_custom_news", you can name it whatever you want, that would collect the news id number and you can point it to a tpl that will show the entire news story. Or you could just use - Simpilot PopUpNews Module 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.