PDA

View Full Version : News Title


marcossalazar
09-11-2007, 08:08 PM
Hello,

For some reason the title for my news module does not display. It seems like this is the case with all the other forums. How do I get the title "News" or the new title I created "Latest Headlines" to show?

Thanks,

Marcos

Brian
09-12-2007, 11:28 AM
It should show the title of the post by default. If you only want to show the title of the module, open your modules/news.php file, look for this code, and remove it.
$mods['title'] = '<a href="' . $vbulletin->options['bburl'] . '/showthread.php?' . $session['sessionurl'] . 't=' . $news['threadid'] . '">' . $news['title'] . '</a>';

Our Sponsors
 

marcossalazar
09-12-2007, 11:29 AM
Awesome. However, will the title of the post still be there? I would like both to be displayed.

Thanks,

Marcos

Brian
09-12-2007, 11:39 AM
No, that just removes the post title and defaults to using the module's title. You could edit that same code and add the title either before or after the <a> tag though.

Our Sponsors
 

marcossalazar
09-12-2007, 11:58 AM
Hey Brian,

Thanks for the quick response. I am not quite sure how you would need to alter the code. Would I need to add a title variable into the code you described to make the post title appear? Or would I need to add new code after this code to make the mod title appear? And in either case, what code would need to be added?

Thanks,

Marcos

Brian
09-12-2007, 12:59 PM
It would need to be something like this:
$mods['title'] = $mods['title'] . ' <a href="' . $vbulletin->options['bburl'] . '/showthread.php?' . $session['sessionurl'] . 't=' . $news['threadid'] . '">' . $news['title'] . '</a>';

marcossalazar
09-13-2007, 12:13 PM
That worked really well. Thanks!

marcossalazar
09-13-2007, 03:15 PM
Hey Brian,

I thought it had done the trick, but it is displaying an error. It displays the title of the module where the title is from the post, but now it displays the title of the latest news story in all the other news stories. And even stranger is that the title gets progressively longer the older the story gets. Is there something in the code that needs to be tweeked?

Thanks,

marcos

Brian
09-14-2007, 12:49 PM
Sorry about that. Try using this code instead and it should do the trick.

$mods['title'] = $newsmod['title'] . ' <a href="' . $vbulletin->options['bburl'] . '/showthread.php?' . $session['sessionurl'] . 't=' . $news['threadid'] . '">' . $news['title'] . '</a>';
(Just changing the 2nd instance of "$mods['title']" to "$newsmod['title']")

marcossalazar
09-17-2007, 11:42 AM
Hello Brian,

I noticed that in the news.php file there are two instances of the code that has to be changes (or replaced in the first instructions you gave). There is code at the very top and then at the bottom. Which one do I change with the most recent code you gave me? Or do I change both?

Thanks,

Marcos

Brian
09-17-2007, 01:19 PM
There should only be one instance of the code I posted in post #2.