News:

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

Main Menu

Custom Action Mod

Started by Norv, May 09, 2006, 08:35:29 PM

Previous topic - Next topic

winrules

you don't need the <? and ?>


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


Silence

ahhhhhhhhhhhhhhhhhhhhhh

YOU ROCK!!

now to find out how to get the output in layout(table) ..

ie like the normal actions...index.php?action=help  ...

winrules

Quote from: Silence on May 15, 2006, 05:07:25 PM
ahhhhhhhhhhhhhhhhhhhhhh

YOU ROCK!!

now to find out how to get the output in layout(table) ..

ie like the normal actions...index.php?action=help  ...
OK, I see what you mean by that, but I won't make it do that by default, I want it to be as custimizable as it can be, you could just copy the HTML from those other pages.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


Silence

not possible to create in mod a wrap or something?... so that it would automaticly come in table .. in theme layout ...
further more this is a great mod!!

winrules

Quote from: Silence on May 15, 2006, 06:11:45 PM
not possible to create in mod a wrap or something?... so that it would automaticly come in table .. in theme layout ...
further more this is a great mod!!
just copy the html from the theme and put it in the page.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


digit

Quote from: winrules on May 15, 2006, 04:13:14 PM
Quote from: digit on May 14, 2006, 02:13:38 PM
Great mod!

I did notice on thing though - when looking at Who's Online all the actions appear to be "Unknown Action"  Is this normal?

Thanks!
You have to define what the action is, so in who.yourlanguage.php in themes/default/languages you would have to add a string for $txt['whoall_youraction']

Perfect - thanks.  Now, how do I delete an action?
Happily using a heavily modified 1.1.16 version of SMF!

2748011 Posts in 320998 Topics by 50986 Members


SOLD my website - thanks it was a good run - they converted to vbadvanced. (and screwed it up good!)

Silence

Quote from: digit on May 16, 2006, 06:29:04 AM
Quote from: winrules on May 15, 2006, 04:13:14 PM
Quote from: digit on May 14, 2006, 02:13:38 PM
Great mod!

I did notice on thing though - when looking at Who's Online all the actions appear to be "Unknown Action"  Is this normal?

Thanks!
You have to define what the action is, so in who.yourlanguage.php in themes/default/languages you would have to add a string for $txt['whoall_youraction']

Perfect - thanks.  Now, how do I delete an action?

Just empty the action box and name and after that ....safe ... this how it works for me ...

Saku

how to hide the costum action for guest??

winrules

Quote from: digit on May 16, 2006, 06:29:04 AM
Quote from: winrules on May 15, 2006, 04:13:14 PM
Quote from: digit on May 14, 2006, 02:13:38 PM
Great mod!

I did notice on thing though - when looking at Who's Online all the actions appear to be "Unknown Action"  Is this normal?

Thanks!
You have to define what the action is, so in who.yourlanguage.php in themes/default/languages you would have to add a string for $txt['whoall_youraction']

Perfect - thanks.  Now, how do I delete an action?
Err you can't right now but that will be in next version :)


Quote from: Sakuragi on May 16, 2006, 11:51:05 AM
how to hide the costum action for guest??
make the page php type and put a call to "is_not_guest()" at the top.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


Jorin

Quote from: winrules on May 15, 2006, 04:13:14 PM
Quote from: nehcregit on May 15, 2006, 05:45:33 AM
Great mod! Use it to show my forum rules in the menü. But one question about it:

I get a lot of errors like this:

8: Use of undefined constant rules - assumed 'rules'
Datei: /srv/www/htdocs/web78/html/smfport/Themes/default/Admin.template.php (eval?)
Zeile: 492

8: Use of undefined constant rules - assumed 'rules'
Datei: /srv/www/htdocs/web78/html/smfport/Themes/default/PersonalMessage.template.php (eval?)
Zeile: 492


...And so on. That were about 40 sites of error messages like this one day! How can I fix this? I'm using 1.1RC2 with default theme. These mods are installed: Custom Action Mod, Security Patch, Custom Profile Field, Sticky First Post.
Have you added any other code (ie in the menu bar), if so can you post it?

Sure. Have made a link to the forum rules:

// Work out where we currently are.
$current_action = 'home';
if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
$current_action = 'admin';
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'rules')))
$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action = 'search';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';

// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first = 'last';
$last = 'first';
}
else
{
$first = 'first';
$last = 'last';
}

// Show the start of the tab section.
echo '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="maintab_' , $first , '">&nbsp;</td>';

// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '">' , $txt[103] , '</a>
</td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Show the [rules] button.
echo ($current_action == 'rules' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'rules' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=rules">' , $txt[rules] , '</a>
</td>' , $current_action == 'rules' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';



Addes "rules" there twice. Once for the change of the active tab and the second for the link himself. Any errors in my code?

mforum

Can i make with this mod a button in index that links to a certain action, like chat or gallery ?  ???
If yes, what is the code i `ll put ?

winrules

Quote from: mforum on May 17, 2006, 03:40:36 AM
Can i make with this mod a button in index that links to a certain action, like chat or gallery ?  ???
If yes, what is the code i `ll put ?
This mod will create the actions, this tutorial might help you.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


mforum

Thanks winrules, you `ve been very helpfull ..!!  :)

littleone

When I added a page it didnt show in the Menu bar.  Any reason?

ivo2296

Any chance to have this mod compatible with smf 1.0.7?

Thank you!

L.G.S

Quote from: littleone on May 18, 2006, 11:40:16 AM
When I added a page it didnt show in the Menu bar.  Any reason?

Because you have to manually add it to the menu
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


winrules

Quote from: ivo2296 on May 18, 2006, 12:43:14 PM
Any chance to have this mod compatible with smf 1.0.7?

Thank you!
No...You couldtry using the Static Page Mod.


Quote from: L.G.S on May 18, 2006, 01:17:16 PM
Quote from: littleone on May 18, 2006, 11:40:16 AM
When I added a page it didnt show in the Menu bar.  Any reason?

Because you have to manually add it to the menu
Also in the next version I might add an option to show a button in the menu bar.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


H

This looks to be a great mod.

Any plans to integrate secondary actions into it? (like smf currently has with ;sa, http://www.simplemachines.org/community/index.php?action=profile;u=24172;sa=summary)
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

winrules

Quote from: huwnet on May 18, 2006, 04:04:03 PM
This looks to be a great mod.

Any plans to integrate secondary actions into it? (like smf currently has with ;sa, http://www.simplemachines.org/community/index.php?action=profile;u=24172;sa=summary)
Good idea, I might add something like this. Maybe I could use something like an action settings page...Sort of like my custom profile field mod.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


Harzem

Here is my "Rules" page done using this mod :) (In fact, I could do this myself, but anyway, I've done it by the mod :D)

http://www.turkproje.org/forum/index.php?action=kurallar

Select a rule category at the left and read it. For example, "General", "Posting", "Avatar and Signatures", etc...

It is not in english but I'm showing the power of this mod ;)

Advertisement: