News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Post Board Select

Started by Norv, May 13, 2008, 11:21:56 PM

Previous topic - Next topic

Norv

Okay, will keep it in mind for the very next release.

It was [SiNaN]'s mod actually, I just took it over. :)
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

iosys

#41
Quote from: akbora on July 09, 2009, 01:27:52 PM
This is very very good mod and perfectly running. I ask  that you can put a button on main page called open new topic? This model with this mod will be very very brilliant...

So, we can open new topic no entering any board inside

Im running simpleportal with my forum integrated.  I made a new simpleportalblock that has a simple HTML link to http://www.myforum.com/introduce-yourself/?action=post [nofollow] .  This works brilliantly since its displayed on the main screen and the user clicks there straight away.  Only problem is that some users dont realise they have to change the dropdown for the board so I get a lot of incorrect posts into the Intro Board.

If/when you do make a frontscreen link update please include something that forces the user to select what board they wany.  Either that or a warning message or something.

Thanks for the great mod too!


EDIT:

Found where it is in SMF2.  Its in Sources/Subs.php.  Find the function just after this line:

//All the buttons we can possible want and then some, try pulling the final list of buttons from cache first.

Find:
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
),


Add After:
'NewPost' => array(
'title' => 'New Post',
'href' => 'http://www.myforum.com/introduce-yourself/?action=post',
'show' => true,
'sub_buttons' => array(
),
),




AAF [nofollow]

iosys

To place a warning message above the board select:

In Themes/default/Post.template.php

Find:
//If we have the board list, let them choose.
if(!empty($context['post_boards'])) {
echo ' <tr>


Add After:
<td colspan="2"><center><h3><b><font color=red>
<br/><br/>
WARNING! Make sure you select the correct board for your post from the dropdown menu below
<br/><br/><br/>
</font></b></h3></center></td></tr><tr>
AAF [nofollow]

Norv

Thank you for sharing your ideas! It is very appreciated. :)

A few notes about the code however:
Inserting a menu item for 'New post'

         'newpost' => array(
            'title' => $txt['newpost'],
            'href' => $boardurl . '/introduce-yourself/?action=post',
            'show' => true,
            'sub_buttons' => array(
            ),
         ),

Please note the use of $txt['newpost'], that is, a variable to hold the contents of the text you wish to appear on the new button. This variable should be defined in a language file, like index.english.php:
Code (find) Select

?>

Code (add before) Select

$txt['newpost'] = 'New Post';

This way, the solution can be ported to multiple languages with no problem, simply by adding a corresponding line in index.{language}.php.
Note also the use of the $boardurl variable, instead of direct URL ($boardurl is the forum URL). I'd recommend the use of a variable: if you change the board URL in the future, like moving the forum to another folder or change domains, using $boardurl instead of hardcoding will ensure that the new URL will be automatically used by the button, thus making your transition smooth.
Please eventually check out for the full hands-on guide to adding tabs in SMF 2.0:
Adding tabs to SMF 2.0

About placing a warning, please note a similar thing: using clear text is not portable, will not work for other languages. It may be better to also add a little variable in Modifications.english.php:
Code (find) Select

?>


Code (add before) Select

$txt['select_board_warning'] = 'WARNING! Make sure you select the correct board for your post from the dropdown menu below.';

then use $txt['select_board_warning'] in Post.template.php.

Thank you again, and I think the next version will include at least the option to insert a reminder (as option in admin panel), it may be useful for others as well.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

sattninja

hi i am running RC2 annd the theme sharp curve can xomeone tell me where to put the sode to make the drop down box apprear in the correct area i installed it and did manual edit using the parser and it puts it in the same spot way at the bottom heres a screen shot



i have also attached my templates that the parser instructed to edit man it is working but it is in the wrong place and i cant figure out where to move the code to make it appear where it is supposed to
Running Rc4

Norv

I'm sorry, I don't really have time to try making edits for custom themes.
Does that happen on the default theme as well?
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

akbora

This mod is good but with trouble, as sattninja say
SMF 2.0.13
Default Theme
Utf8 Turkish
---------------

Norv

Can you please tell, what kind of trouble are you having?
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

akbora

Let me one minute (not like Turkish Prime Minister :)

SS is coming
SMF 2.0.13
Default Theme
Utf8 Turkish
---------------

akbora






1st picture without PBS
2nd picture with PBS
SMF 2.0.13
Default Theme
Utf8 Turkish
---------------

Norv

I am unable to replicate that, using non-modded installation, with default settings, UTF-8 forum and database, and Turkish-utf8 language pack.

What other mods do you have installed?
Can you please post your Post.template.php here?
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

sattninja

Quote from: Norv on December 21, 2009, 12:08:31 PM
I'm sorry, I don't really have time to try making edits for custom themes.
Does that happen on the default theme as well?

i have the exact same problem in the default theme



its like the code is being put in the wrong place or something in the post template
Running Rc4

sattninja

i just added all the code manualy and still the same thing puts it all the way down at the bottom
Running Rc4

Norv

sattninja: Can you please try using the attached file, instead of the one you posted? Note that only PBS seems installed on it. (if you installed other mods meanwhile, please don't use it).
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

sattninja

darn it i knew i should have attached a updated one sorry here is the current one i am using if its not to much trouble
Running Rc4

Norv

No worries, I'll take a look. Eventually, please note that I've updated the package on mod site, too. Please consider uninstalling this version, and installing the last version, 1.2. It will be easier later when you may need to update it again or uninstall it.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

Norv

Attached your file, too.

However, I strongly recommend uninstalling and installing normally, instead of using this file, as I said above.
Then, please tell how it goes.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

sattninja

i downloaded the new mod and installed and it worked great however i still had the other box down at the bottom probably left over from the last version so i manually deleted it and everything in working great

thanks so much ;D ;D ;D ;D
Running Rc4

Norv

Cheers, good to hear it works then!
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

sattninja

you r as they say

DA MAN!!!!!!
Running Rc4

Advertisement: