News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

[HELP] Action

Started by DreamZ1337, December 10, 2012, 11:02:11 AM

Previous topic - Next topic

DreamZ1337

Hello,
How can i make a new action? Where the user who press on it get redirect? Look at this they got a action what called for "Banlist" and "SA:MP"
I just want another action called for something else, but when they press on it they get redirect.

And, how do i delete the action "Help"?

If you know please tell me :)

Thank you.

Kindred

creating a new ACTION is different from creating a new menu item.

to create a new menu item:
http://wiki.simplemachines.org/smf/Buttons_-_How_do_I_add_buttons_to_SMF_2.0


for creating new ACTIONS, you have to create target source and template files and then add the action into the array in index.php
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

DreamZ1337

When i edit one, we must have like action?= or something i wait it to redirect to example: yourdomain.com/amxbans [nofollow]

Understand?
It only redirect with yourdomain.com/index?=action [nofollow] blabla...

Hope you help me :)

Kindred

Quote from: Kindred on December 10, 2012, 12:24:32 PM
for creating new ACTIONS, you have to create target source and template files and then add the action into the array in index.php

take a look at some mods to see how they do it... if you want to use ?action=****

However, if all you want to do is add a link to somewhere else (without wrapping it in the forum) then just follow the instructions in the wiki that I linked to. -- that explains how to make a menu item with or without a dropdown
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

DreamZ1337

And, how do i make the menu without sub buttons? ;)

DreamZ1337

Alright i found out, but last question.
I can't get it to work that when they press the menu i made, it only goes to the action?=something
Explain me abit better please, im not that good, you know..

Kindred

if you already HAVE an action defined and you just want to link to it, then, in the href field, put the following


'href' => $scripturl . '?action=****',


if you are talking about needing to DEFINE a new ACTION, then you are talking about some custom coding...   as I said, look at how some of the various mods have done it - creating a new source file and a new template file.
i.e. /Sources/MyAction.php and /Themes/default/MyAction.template.php
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

DreamZ1337

No i mean, that it don't get redirect to action?=

it get redirect example to www.yourdomain.com/*** [nofollow]

understand?
But this only gets redirect something with index.php/***

Kindred

no. I have no idea what you are trying to say.

If you need to create a new forum page, then you have to cretae a source and template file and add the action into the array.
You can then create a new menu item pointing to the action using the code that I showed.


If you are not creating an action, i.e. you just want to point the menu item at some external page, there is no need for any redirect or any action at all.

'href' => 'http://YOURURL.com',
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

DreamZ1337

Thanks alot!
But we can make only 1 menu? I tried to make 2 but the 1 i made before get's removed o.o


Kindred

you can make as many additional menu items as you want.

Just follow the same instructions for each one.
Do one. confirm that it works, then do the next. Unless you know what the code does specifically, don't try to take shortcuts.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

DreamZ1337


Advertisement: