SMF 2.0.7 New Topic Link

Started by vbbanks, March 29, 2014, 03:39:25 PM

Previous topic - Next topic

vbbanks

I don't know if this is a strange request or not but here it goes ..
how can i edit the link to the " new topic " button?

I don't need to know why i want to do this .. i just want to know how i can do this

Sir Osis of Liver

It's in /Themes/default/languages/index.english.php.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

vbbanks

I don't want to change the name " New Topic " I want to change the link it goes to when you click the " New Topic " button

Sir Osis of Liver

Ok, misread the question.  Will have to poke around a bit for that ........

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Sir Osis of Liver

It's in MessageIndex.template.php -



// Create the button set...
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),



Simplest way is to substitute a direct url, like this -



// Create the button set...
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => "http://www.simplemachines.org", 'active' => true),


Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

vbbanks

This seems like the right place to make the change i want but i keep getting a :

Template Parse Error!
There was a problem loading the /Themes/default/MessageIndex.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

Antechinus

What's the exact code you're using there?

Sir Osis of Liver

You did it wrong.  Post your code.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

vbbanks

// Create the button set...
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => "http://www.simplemachines.org", 'active' => true),
               'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
);

vbbanks

You are right .. So sorry i did actually do something wrong ..

Thank You SO Much .. That Did exactly What I Wanted :D

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Advertisement: