Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Norv on May 09, 2006, 08:35:29 PM

Title: Custom Action Mod
Post by: Norv on May 09, 2006, 08:35:29 PM
Link to Mod (http://mods.simplemachines.org/index.php?mod=331)

This mod will add an unlimited number of custom actions, configurable in Features and Options. There are 3 types, HTML, BBC, and PHP. They can be accesed by going to http://www.yoursite.com/smf/index.php?action=action name. Each action has an unlimited number of sub-actions, which can be accessed by going to http://www.yoursite.com/smf/index.php?action=action name;sa=sub-action name.


Enhancement for it:
If you wish to make it work with the link tree, you may find useful these instructions DanCarroll has been nice to share:
Making Link Tree work with Custom Action Mod (http://www.simplemachines.org/community/index.php?topic=86793.msg3193990#msg3193990)
Title: Re: Custom Action Mod
Post by: mindvsmind on May 10, 2006, 03:37:59 AM
nice very nice good job
Title: Re: Custom Action Mod
Post by: Leonard C on May 10, 2006, 05:11:56 AM
Very useful mod  ;) Thanks
Title: Re: Custom Action Mod
Post by: Stuart on May 10, 2006, 08:57:25 AM
 Bit of a shame that it's not compatible with SMF 1.0.7.  :(   
Title: Re: Custom Action Mod
Post by: uberjon on May 10, 2006, 04:46:14 PM
3.     Execute Modification     ./Sources/ModSettings.php     Test failed

want to do a friend a favor and help him out with this ;'( i want to use it

odd thing is it works with my modtest forum :'(
Title: Re: Custom Action Mod
Post by: winrules on May 10, 2006, 04:47:54 PM
Quote from: uberjon on May 10, 2006, 04:46:14 PM
3.     Execute Modification     ./Sources/ModSettings.php     Test failed

want to do a friend a favor and help him out with this ;'( i want to use it

odd thing is it works with my modtest forum :'(
what other mods do you ahve installed?
Title: Re: Custom Action Mod
Post by: uberjon on May 10, 2006, 04:50:44 PM
    Mod Name     Version     
1.    Karma Description Mod    1.9.7    
2.    Custom Profile Mod    2.14    ---- tried to update to your latest version and my error logs got flooded again. :'(
3.    SMF 1.0.7 / 1.1 RC2 Update    1.0    
4.    Users Online Today Mod    1.3.1    
5.    Membergroup Color Legend    1.1    
6.    Custom Action Mod    1.0    - uploaded only not installed.
7.    PJIRC Integrated Chat Mod    2.0    

i got all those

i have the exact stuff installed on my mod test site.

only diference is on the mod test site i temporarly used tp for a bit but removed it.

would it be possible for me to make a copy from one modsetting.php and put in the other source area? making a backup of the orginal of course.

edit::: eh was inpatient :/ i tried that with the copy from the modtest it worked ;) :D
Title: Re: Custom Action Mod
Post by: winrules on May 10, 2006, 09:05:07 PM
could you pm me your modsettings.php?

also, could you please post the error getting with the custom profile field mod in the mods topic so I can fix it :)
Title: Re: Custom Action Mod
Post by: jerm on May 11, 2006, 09:33:47 PM
would be nice to have a "delete action" option
Title: Re: Custom Action Mod
Post by: winrules on May 12, 2006, 04:12:14 PM
Quote from: electrohome on May 11, 2006, 09:33:47 PM
would be nice to have a "delete action" option
That'll be in next version
Title: Re: Custom Action Mod
Post by: Garry on May 12, 2006, 07:50:27 PM
--------------------------------------------------------------------------------
Yea as I said

It installed ok

I saw that tab

What does it do
  Where does that link go to 
is there any help file to show you how to run it

I am a stupid newby   Grin 
Title: Re: Custom Action Mod
Post by: winrules on May 12, 2006, 09:24:21 PM
Quote from: Garry on May 12, 2006, 07:50:27 PM
--------------------------------------------------------------------------------
Yea as I said

It installed ok

I saw that tab

What does it do
  Where does that link go to 
is there any help file to show you how to run it

I am a stupid newby   Grin 
click on the link, and then click on add an action
Title: Re: Custom Action Mod
Post by: Garry on May 12, 2006, 09:31:21 PM
Quote
--------------------------------------------------------------------------------
Yea as I said

It installed ok

I saw that tab

What does it do
Where does that link go to 
is there any help file to show you how to run it

I am a stupid newby   Grin 

Quote
click on the link, and then click on add an action

What is an ACTION
Where do I find the list of ACTIONS

I am a newby and I dont understand a lot of this  
I am used to programs that have help screens or a tutorial to show you how to use the new functions


What was that link to supposed to be for ...............

click on it and see where it goes  and then please tell me what it means  

http://www.yoursite.com/smf/index.php?action=action


Title: Re: Custom Action Mod
Post by: winrules on May 12, 2006, 09:33:09 PM
Quote from: Garry on May 12, 2006, 09:31:21 PM
[quote ]
--------------------------------------------------------------------------------
Yea as I said

It installed ok

I saw that tab

What does it do
  Where does that link go to 
is there any help file to show you how to run it

I am a stupid newby   Grin 

Quote
click on the link, and then click on add an action

What is an ACTION
Where do I find the list of ACTIONS

I am a newby and I dont understand a lot of this  
I am used to programs that have help screens or a tutorial to show you how to use the new functions



[/quote]
go to features and options in the admin panel, and then click on "Custom Actions", and then click on "Add an action"
Title: Re: Custom Action Mod
Post by: Garry on May 12, 2006, 10:15:35 PM
Quote
click on the link, and then click on add an action

What is an ACTION

Where do I find the list of ACTIONS

I am a newby and I dont understand a lot of this  
I am used to programs that have help screens or a tutorial to show you how to use the new functions


I am not trying to be smart or nasty as I know you are trying to help me

But could you take the time to read my post and answer the questions i have asked !!!!


[/quote]
go to features and options in the admin panel, and then click on "Custom Actions", and then click on "Add an action"
[/quote]

I have done as you said by going to the

Admin
Features and Options
ADD an action


Now I have two areas that I dont know what they are for   !!!!!!



What the Hell is an ACTION ??????




Can you please take the time to read my questions


Title: Re: Custom Action Mod
Post by: karone on May 13, 2006, 02:21:36 AM
Garry, if you don't know what this mod does, why did you install it?
Title: Re: Custom Action Mod
Post by: mforum on May 13, 2006, 03:53:04 AM
I would like to have an example of what this mod does exactly, please  ::)
Maybe is something i can use it and don`t know it`s there.....

Thanks
Title: Re: Custom Action Mod
Post by: Garry on May 13, 2006, 07:01:15 AM
Quote from: karone on May 13, 2006, 02:21:36 AM
Garry, if you don't know what this mod does, why did you install it?

I installed it becuase it is the only way you can see if it is something you like or not

I didn't know that it would be so hard for " winrules  " to read my question and give me a straight answer

This isnt a complaint as the FORUM was FREE  and the MODS that I have installed were FREE and as we all know ....

Beggers cant complain about the generosity of others , but being a newbie to this kind of thing , I didnt know that you have to ask a question about 6 times and in 3 or 4 different formats before it will get answered .............

There are no help screens or instructions with these MODS so how do you know if they are doing what there supposed to do if you dont know what to type into the text boxes and data input areas to make them work.............

I may sound like i am whinning or angry , but I am not . Id just like to know what I am supposed to do with a Mod so I can determine if it is working or if it is of any walue to me for what I am doing
Title: Re: Custom Action Mod
Post by: Dannii on May 13, 2006, 07:06:16 AM
http://www.simplemachines.org/community/index.php?action=unread
http://www.simplemachines.org/community/index.php?action=unreadreplies
http://www.simplemachines.org/community/index.php?action=stats
http://www.simplemachines.org/community/index.php?action=mlist
http://www.simplemachines.org/community/index.php?action=profile

These are all actions. Actions are stuff you do in forums. This mod lets you make custom actions more easily.
Title: Re: Custom Action Mod
Post by: Garry on May 13, 2006, 07:15:14 AM
Wow  I am pretty impressed with the examples  as they do many things I have been trying to do

Would there be an example of the code that was put into the box in the actual MOD to show how it is done
Title: Re: Custom Action Mod
Post by: Dannii on May 13, 2006, 07:16:59 AM
As it says in the description, you can use either html, BBCode or php.
Title: Re: Custom Action Mod
Post by: Garry on May 13, 2006, 07:58:13 AM
I guess I am a total idiot and cant simplly express the concept of

do you have an example of the code that I am to use

I am really trying to learn some things here and I feel like a total idiot becuase I think I am asking the correct questions , but I dont seem to be getting anywhere



Can someone tell me what goes in each area and where do I learn more   about what I would need to know to put in the code area

In example.....

What code would I put in the code box to do this

http://www.simplemachines.org/community/index.php?action=mlist

Title: Re: Custom Action Mod
Post by: mforum on May 13, 2006, 09:47:31 AM
I understand now what this mod does, thanks a lot eldacar ..!!

Garry, i think you must be a coder to make an action, you put html or php code in this box  ::)

Overall, NICE MOD !!!!!!!!!!!
Title: Re: Custom Action Mod
Post by: Garry on May 13, 2006, 10:03:39 AM
Quote from: mforum on May 13, 2006, 09:47:31 AM
I understand now what this mod does, thanks a lot eldacar ..!!

Garry, i think you must be a coder to make an action, you put html or php code in this box  ::)

Overall, NICE MOD !!!!!!!!!!!

Yes I see that youu need to put some code in the box

what I am hoping is that someone will post what needs to go in the box so I can see it work on my own forum and start to understand it

Title: Re: Custom Action Mod
Post by: mforum on May 13, 2006, 10:11:01 AM
What goes into the box depends from the action you wanna make  ;)
It would be usefull for us newbies someone post the code of a certain action  :)
Title: Re: Custom Action Mod
Post by: Garry on May 13, 2006, 11:01:30 AM
Quote from: mforum on May 13, 2006, 10:11:01 AM
What goes into the box depends from the action you wanna make  ;)
It would be usefull for us newbies someone post the code of a certain action  :)

This is what I have been trying to say for over 12 hours

Like a quick copy and paste into the code function in a post and we could see and use it to understand what it is all about
Title: Re: Custom Action Mod
Post by: winrules on May 13, 2006, 08:39:38 PM
what type of example would you like to see?
You don't need this mod to use the default smf features, link the memberlist (?action=mlist)
Title: Re: Custom Action Mod
Post by: Garry on May 13, 2006, 10:13:31 PM
Any example would be great

and any help in using the
Quotedefault smf features, link the memberlist (?action=mlist)

would be greatly appreciated

Like where would I find all the actions  that are available




Im just an old guy trying to learn something new for the fun of it

thanks for the reply
Title: Re: Custom Action Mod
Post by: winrules on May 13, 2006, 10:18:09 PM
Quote from: Garry on May 13, 2006, 10:13:31 PM
Any example would be great

and any help in using the
Quotedefault smf features, link the memberlist (?action=mlist)

would be greatly appreciated

Like where would I find all the actions  that are available




Im just an old guy trying to learn something new for the fun of it

thanks for the reply
there is a long list of theme in the actionArray in index.php.
Title: Re: Custom Action Mod
Post by: woden on May 14, 2006, 12:20:11 AM
You can use this mod to make a rules page or you can make article pages etc. You can put any kind of info you want in there and it will be surrounded by the forums format. It doesn't have to be some kind of forum code.

Its very handy.
Title: Re: Custom Action Mod
Post by: Garry on May 14, 2006, 12:33:06 AM
Quote from: woden on May 14, 2006, 12:20:11 AM
You can use this mod to make a rules page or you can make article pages etc. You can put any kind of info you want in there and it will be surrounded by the forums format. It doesn't have to be some kind of forum code.

Its very handy.

Thanks woody

Can you copy what you have in one of the action boxes  " such as a Rules page " and paste it in to a post  , so I can see what your talking about

along with the name  and other stuff that the action mod calls for




also

what goes in the other boxes  and where do I find " The Output " this action makes  and how do you call it


Like all I am looking for is someone to show me what they have put into to data imput areas

and tell me where I find the output from the action Mod

I really cant believe how hard this has been to get someone to show me what to do








Title: Re: Custom Action Mod
Post by: woden on May 14, 2006, 02:29:44 AM
when you fill in the form:

name is the name of the action (or webpage), if you put rules, then when you get ready to link to it use forum/index.php?action=rules

type is either HTML, BBC or PHP, you pick which one you'll be using

page title is what will show in the browser window as the page title, not the file name


code is where you type in your info, webpage stuff, pictures etc, your content for the page

for instance

<h3>This page was made with the custom action mod</h3>
Ain't it nifty


for a real example see http://www.shelldwellers.com/index.php?action=articles
Title: Re: Custom Action Mod
Post by: ikbenivo on May 14, 2006, 06:44:42 AM
great mod! thanks!
Title: Re: Custom Action Mod
Post by: Garry on May 14, 2006, 08:10:44 AM
A thank You to all who had the patients with me to get me through learning how to run this mod

As a newbie , I find many MODS on here hard to understand as there are no real instructions with them for us old Farts that are PHP Forum Challenged

Thank you all again

Woden

If I may ask you a couple of questions ?

On that forum you sent me to to see a real example
Title: Re: Custom Action Mod
Post by: 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!
Title: Re: Custom Action Mod
Post by: lj on May 14, 2006, 08:33:20 PM
When I try to install this I get
Quote500 USER: command requires a parameter.
any ideas what it means?
Title: Re: Custom Action Mod
Post by: Jorin 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.
Title: Re: Custom Action Mod
Post by: Silence on May 15, 2006, 10:28:43 AM
Installed with no errors ...
But if i add a action ....(php)

Parse error: parse error in Sources\Load.php(1623) : eval()'d code(7) : eval()'d code on line 1


how to solve?

And i thought the added action woulld be in a table in same layout... its now shown UNDER excisting layout ...(when adding BBC or html)

Here my html action:


Title: Re: Custom Action Mod
Post by: 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']


Quote from: lj on May 14, 2006, 08:33:20 PM
When I try to install this I get
Quote500 USER: command requires a parameter.
any ideas what it means?
Have you successfull installed any other mods?


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?


Quote from: Silence on May 15, 2006, 10:28:43 AM
Installed with no errors ...
But if i add a action ....(php)

Parse error: parse error in Sources\Load.php(1623) : eval()'d code(7) : eval()'d code on line 1


how to solve?

And i thought the added action woulld be in a table in same layout... its now shown UNDER excisting layout ...(when adding BBC or html)

Here my html action:



With the parse error, that's an error in the code you're entering, not with the mod. If you post the code you're using I can help you fix it. With the layout, I don't get what you mean, isn't that what it's supposed to do?
Title: Re: Custom Action Mod
Post by: Silence on May 15, 2006, 04:59:15 PM
i tried this in php action box :

<?

echo"JUST A TEST FOR PHP ACTION"
."";

?>


this gives error ...
Title: Re: Custom Action Mod
Post by: winrules on May 15, 2006, 05:01:39 PM
you don't need the <? and ?>
Title: Re: Custom Action Mod
Post by: 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  ...
Title: Re: Custom Action Mod
Post by: winrules on May 15, 2006, 05:19:08 PM
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.
Title: Re: Custom Action Mod
Post by: 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!!
Title: Re: Custom Action Mod
Post by: winrules on May 15, 2006, 09:01:04 PM
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.
Title: Re: Custom Action Mod
Post by: 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?
Title: Re: Custom Action Mod
Post by: Silence on May 16, 2006, 06:31:17 AM
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 ...
Title: Re: Custom Action Mod
Post by: Saku on May 16, 2006, 11:51:05 AM
how to hide the costum action for guest??
Title: Re: Custom Action Mod
Post by: winrules on May 16, 2006, 04:49:03 PM
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.
Title: Re: Custom Action Mod
Post by: Jorin on May 17, 2006, 02:08:59 AM
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?
Title: Re: Custom Action Mod
Post by: 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 ?
Title: Re: Custom Action Mod
Post by: winrules on May 17, 2006, 03:50:29 PM
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 (http://www.simplemachines.org/community/index.php?topic=63203.0) might help you.
Title: Re: Custom Action Mod
Post by: mforum on May 18, 2006, 03:52:05 AM
Thanks winrules, you `ve been very helpfull ..!!  :)
Title: Re: Custom Action Mod
Post by: littleone on May 18, 2006, 11:40:16 AM
When I added a page it didnt show in the Menu bar.  Any reason?
Title: Re: Custom Action Mod
Post by: ivo2296 on May 18, 2006, 12:43:14 PM
Any chance to have this mod compatible with smf 1.0.7?

Thank you!
Title: Re: Custom Action Mod
Post by: 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
Title: Re: Custom Action Mod
Post by: winrules on May 18, 2006, 03:53:58 PM
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 (http://mods.simplemachines.org/index.php?mod=130).


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.
Title: Re: Custom Action Mod
Post by: H 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)
Title: Re: Custom Action Mod
Post by: winrules on May 18, 2006, 04:07:33 PM
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.
Title: Re: Custom Action Mod
Post by: Harzem on May 18, 2006, 05:00:53 PM
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 ;)
Title: Re: Custom Action Mod
Post by: L.G.S on May 18, 2006, 05:54:22 PM
Woa that's nice, any chance of posting the code you used to have the BG etc?
Title: Re: Custom Action Mod
Post by: Harzem on May 18, 2006, 05:56:56 PM
uhm, what are you calling as BG? (back-ground?)
Title: Re: Custom Action Mod
Post by: Jorin on May 19, 2006, 02:33:21 AM
Don't know what L.G.S. means with BG, but I'm also interested in the code you are using, HarzeM. How did you made the changes to the right table, did you use html and frames?

@winrules: Any idea about my error messages? Am I the only one with this error messages using this great mod?
Title: Re: Custom Action Mod
Post by: Dannii on May 19, 2006, 03:27:01 AM
subactions (as well as any other $_GET variable) can easily by accessed with PHP. Although obviously not with only html or BBCodes.
Title: Re: Custom Action Mod
Post by: Jorin on May 19, 2006, 03:35:56 AM
Thanks a lot, but this doesn't help me a lot  :-[

Need some examples to learn  ;)
Title: Re: Custom Action Mod
Post by: L.G.S on May 19, 2006, 11:00:11 AM
Quote from: HarzeM on May 18, 2006, 05:56:56 PM
uhm, what are you calling as BG? (back-ground?)

Sorry I run a GFX forum so I'm used to posting bg ;D

Yes I mean background
Title: Re: Custom Action Mod
Post by: jimbo21 on May 19, 2006, 01:22:42 PM
WOW great mod. I have already put it to use in my forum.
http://www.talk-baseball.com/index.php?action=MLB
I just created and HTML page and put to code into a custom action. Works perfect. Thanks!
Title: Re: Custom Action Mod
Post by: uberjon on May 19, 2006, 01:30:03 PM
basicaly this mod imo should be standard on smf because its so useful :D

i love it. well basicaly i love winrules because i know am proud to say i use 2 of his mods on my forum ^^

yo winrules if you would add a board to your forum for this mod. il post some of my example pages in code for people to use.

i searched the web for html templates to make nifty looking pages to use with this and they own ^^

:EDIT:

um. can u make a remove box in next verxsion? so it dont take up room in admin cp :P
Title: Re: Custom Action Mod
Post by: winrules on May 19, 2006, 03:51:54 PM
Quote from: nehcregit on May 19, 2006, 02:33:21 AM
Don't know what L.G.S. means with BG, but I'm also interested in the code you are using, HarzeM. How did you made the changes to the right table, did you use html and frames?

@winrules: Any idea about my error messages? Am I the only one with this error messages using this great mod?
With the error messages, In the code you added for the button, $txt[rules] should be $txt['rules'].


Quote from: uberjon on May 19, 2006, 01:30:03 PM
basicaly this mod imo should be standard on smf because its so useful :D

i love it. well basicaly i love winrules because i know am proud to say i use 2 of his mods on my forum ^^

yo winrules if you would add a board to your forum for this mod. il post some of my example pages in code for people to use.

i searched the web for html templates to make nifty looking pages to use with this and they own ^^

:EDIT:

um. can u make a remove box in next verxsion? so it dont take up room in admin cp :P
OK i'll do it. There will be a remove action button in the next version.
Title: Re: Custom Action Mod
Post by: Jorin on May 20, 2006, 06:57:54 AM
Quote from: winrules on May 19, 2006, 03:51:54 PM
Quote from: nehcregit on May 19, 2006, 02:33:21 AM
@winrules: Any idea about my error messages? Am I the only one with this error messages using this great mod?
With the error messages, In the code you added for the button, $txt[rules] should be $txt['rules'].

That's all?  :-[ Thanks a lot!  :)
Title: Re: Custom Action Mod
Post by: uberjon on May 20, 2006, 04:59:16 PM
seems i found a small bug in the action mod :;(

when i try to copy alot of html into the box it does it just fine but when i save it it deletes the last part to make it all fit or somethig :S

just ignore the content in this just to show u how long it is :P

er... nvm wont let me post
QuoteThe following error or errors occurred while posting this message:
The message exceeds the maximum allowed length (65530 characters).

it works well in a program i am using to help me with the html.. but it deletes part of it when i try to use it :'(

can u fix this?
Title: Re: Custom Action Mod
Post by: winrules on May 20, 2006, 05:49:18 PM
Quote from: uberjon on May 20, 2006, 04:59:16 PM
seems i found a small bug in the action mod :;(

when i try to copy alot of html into the box it does it just fine but when i save it it deletes the last part to make it all fit or somethig :S

just ignore the content in this just to show u how long it is :P

er... nvm wont let me post
QuoteThe following error or errors occurred while posting this message:
The message exceeds the maximum allowed length (65530 characters).

it works well in a program i am using to help me with the html.. but it deletes part of it when i try to use it :'(

can u fix this?
It's not a bug, it's that the database column is a TEXT column, which limits the data to 65535 characters. If you want to use this mod with a something longer than that, you will have to set the "value" column in the settings table to MEDIUMTEXT or LONGTEXT.
Title: Re: Custom Action Mod
Post by: winrules on May 21, 2006, 07:49:33 PM
Version 2.0 has been released! This version adds an option to delete actions, and adds sub-actions.
Title: Re: Custom Action Mod
Post by: mforum on May 22, 2006, 03:36:01 AM
What is an sub-action ?  ???
Title: Re: Custom Action Mod
Post by: Dannii on May 22, 2006, 03:59:51 AM
sa=something
Title: Re: Custom Action Mod
Post by: gerrymore on May 22, 2006, 05:32:09 PM
Has anyone tried this mod with Tiny Portal yet?
Title: Re: Custom Action Mod
Post by: winrules on May 22, 2006, 05:56:56 PM
Quote from: gerrymore on May 22, 2006, 05:32:09 PM
Has anyone tried this mod with Tiny Portal yet?
I use tinyportal, too. It should work just fine.
Title: Re: Custom Action Mod
Post by: Niteblade on June 04, 2006, 11:36:35 AM
omg.

*sings praises for this mod*

Now, how do I associate the custom action with a description in the 'Who's Online' ... Right now, it says "unknown action"

I also created a button for my custom action. However, click on the button does not highlight the background of the button itself; instead the 'Home' button becomes highlighted. My custom button does work for my custom action, but the button does not visually indicated that it is the one activated.

If you would, you could come to my forum and click on the shop button to see what I'm talking about. (See signature).
Title: Re: Custom Action Mod
Post by: winrules on June 04, 2006, 01:21:56 PM
Did you use the tutorial in the graphics board? It looks like you skipped step number 1. As for the who's online thing, look here: http://www.simplemachines.org/community/index.php?topic=89923.0
I will also implement that functionabillity into the next version of the mod.
Title: Re: Custom Action Mod
Post by: Niteblade on June 04, 2006, 02:07:54 PM
Quote from: winrules on June 04, 2006, 01:21:56 PM
Did you use the tutorial in the graphics board? It looks like you skipped step number 1. As for the who's online thing, look here: http://www.simplemachines.org/community/index.php?topic=89923.0
I will also implement that functionabillity into the next version of the mod.

Yes; thank you.

And by the way, the link is here (http://www.simplemachines.org/community/index.php?topic=63203.0) for making sure the background of the button indicates that the button is activated. The "Step 1" that was mentioned in the quote of this post.

Cheers.
Title: Re: Custom Action Mod
Post by: Garry on June 15, 2006, 10:58:35 PM
Hi
I installed version 2  after uninstalling version 1

I like the delete an action addition

Not quite sure I understand the logic of the sub action section

can you give me an idea of how that function is sypposed to be used  and when

thanks

Title: Re: Custom Action Mod
Post by: winrules on June 16, 2006, 08:27:39 AM
each sub action can be accessed by going to index.php?action=actionname;sa=subactionname
Title: Re: Custom Action Mod
Post by: bugsmi0 on June 27, 2006, 04:37:46 AM
How to add a menu using the custom action ?

I tried to set it up like the rest of the menus but the new menu does not appear in the nav bar in the default themplate
Title: Re: Custom Action Mod
Post by: winrules on June 27, 2006, 09:59:31 AM
Look here: http://www.simplemachines.org/community/index.php?topic=63203.0
Title: Re: Custom Action Mod
Post by: Vinspire on July 24, 2006, 07:34:44 AM
winrules, i've installed this mod but i've no idea how to use it ... :(

first of all, how do i do this ?

A mod to ask the forummers how did they find out about the site when they are registering themself in the forum.
Title: Re: Custom Action Mod
Post by: winrules on August 22, 2006, 04:37:59 PM
Version 2.01 has been released! This version adds 1.1 RC3 support.
Title: Re: Custom Action Mod
Post by: JPDeni on August 24, 2006, 02:38:55 PM
I've been writing a bunch of php pages through TP and someone suggested that I could use this mod so that I could have a URL that said something like

index?action=gallery

instead of what I have now, which is

index?page=7

Would I need to copy everything from the php page into the textarea that says "code" in the custom actions mod in order to do this? Or is there some way I can tell the custom actions mod "go pick up the php from page 7"?
Title: Re: Custom Action Mod
Post by: winrules on August 24, 2006, 05:36:54 PM
Quote from: JPDeni on August 24, 2006, 02:38:55 PM
I've been writing a bunch of php pages through TP and someone suggested that I could use this mod so that I could have a URL that said something like

index?action=gallery

instead of what I have now, which is

index?page=7

Would I need to copy everything from the php page into the textarea that says "code" in the custom actions mod in order to do this? Or is there some way I can tell the custom actions mod "go pick up the php from page 7"?
You will have to manually copy it. There is no converter script from TinyPortal articles.
Title: Re: Custom Action Mod
Post by: JPDeni on August 24, 2006, 06:39:47 PM
Thank you. That helps a whole bunch.  :)
Title: Re: Custom Action Mod
Post by: chinclub on August 25, 2006, 11:23:51 AM
I'm needing a little help with my code.  I am trying to pull some of the SSI forum codes using PHP but I keep getting errors.  I am not really good with PHP so I'm sure I am making a really stupid mistake.

The code I am trying to use is:

<?php require("/home/fsvzwtpl/public_html/chinclub/forum/SSI.php"); ?>
<?php ssi_recentTopics(); ?>

Title: Re: Custom Action Mod
Post by: JPDeni on August 25, 2006, 11:30:22 AM
Don't put in the

<?php

or

?>

Just use

require("/home/fsvzwtpl/public_html/chinclub/forum/SSI.php");
ssi_recentTopics();

Give that a try.  :)
Title: Re: Custom Action Mod
Post by: chinclub on August 25, 2006, 01:31:43 PM
That did it.  THANKS!!  :D
Title: Re: Custom Action Mod
Post by: winrules on August 27, 2006, 06:25:34 PM
Version 2.02 has been released! This version fixes a security hole. All users are strongly encouraged to upgrade. Big Thanks to HarzeM for discovering the hole.
Title: Re: Custom Action Mod
Post by: chinclub on August 27, 2006, 07:24:36 PM
How do you upgrade?  Must you uninstall the first one before instaling the second?

Also, what was the security problem?
Title: Re: Custom Action Mod
Post by: winrules on August 27, 2006, 08:48:27 PM
Quote from: chinclub on August 27, 2006, 07:24:36 PM
How do you upgrade?  Must you uninstall the first one before instaling the second?

Also, what was the security problem?
Just upload the new version, and hit [Upgrade] should work :)

Sorry, but IMO I shouldn't post details about the problem yet.
Title: Re: Custom Action Mod
Post by: chinclub on August 27, 2006, 08:58:36 PM
The only reason I ask is because somehow people have been able to register to my board without my permission.  I have it set that all accounts must be approved by admin.  I am getting 1-3 porn people a night gaining full access and posting trash on my forum.  I can't find out how they are getting in.  That is probably not the security hole from this script but I am desperate to find a way to stop it.
Title: Re: Custom Action Mod
Post by: winrules on August 28, 2006, 10:38:41 AM
Quote from: chinclub on August 27, 2006, 08:58:36 PM
The only reason I ask is because somehow people have been able to register to my board without my permission.  I have it set that all accounts must be approved by admin.  I am getting 1-3 porn people a night gaining full access and posting trash on my forum.  I can't find out how they are getting in.  That is probably not the security hole from this script but I am desperate to find a way to stop it.
That shouldn't be caused by this mod...You should make a topic about it in General English Support (http://www.simplemachines.org/community/index.php?board=9.0) if you think it's a SMF issue.

Edit: 1,111th post :)
Title: Re: Custom Action Mod
Post by: Kettu on August 29, 2006, 08:29:57 AM
If I use Type php and add

if ($context['user']['is_guest'])
echo 'You are not allowed to see this page. Please login.';

if ($context['user']['is_logged'])
echo 'This is a test page.';


the page works fine for guests and users as it should be. But, if I try to delete another action I get the error:

QuoteYou have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'user']['is_guest'])
echo 'You are not allowed to see this page
Datei: .../smf/Sources/CustomAction.php
Zeile: 269

What is the mistake? As I know I shouldn't use <php ?> around the php code.
Title: Re: Custom Action Mod
Post by: winrules on August 29, 2006, 09:56:17 AM
Quote from: Kettu on August 29, 2006, 08:29:57 AM
If I use Type php and add

if ($context['user']['is_guest'])
echo 'You are not allowed to see this page. Please login.';

if ($context['user']['is_logged'])
echo 'This is a test page.';


the page works fine for guests and users as it should be. But, if I try to delete another action I get the error:

QuoteYou have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'user']['is_guest'])
echo 'You are not allowed to see this page
Datei: .../smf/Sources/CustomAction.php
Zeile: 269

What is the mistake? As I know I shouldn't use <php ?> around the php code.
Umm can you try reuploading CustomAction.php?
Title: Re: Custom Action Mod
Post by: Kettu on August 29, 2006, 11:02:48 AM
Quote from: winrules on August 29, 2006, 09:56:17 AM
Umm can you try reuploading CustomAction.php?
Still the same error.
Title: Re: Custom Action Mod
Post by: winrules on August 29, 2006, 11:51:38 AM
Version 2.03 has been released! This version fixes a bug with deleting fields.


Quote from: Kettu on August 29, 2006, 11:02:48 AM
Quote from: winrules on August 29, 2006, 09:56:17 AM
Umm can you try reuploading CustomAction.php?
Still the same error.
Try this version :)
Title: Re: Custom Action Mod
Post by: Kettu on August 29, 2006, 12:23:18 PM
Quote from: winrules on August 29, 2006, 11:51:38 AM
Version 2.03 has been released! This version fixes a bug with deleting fields.

Quote from: Kettu on August 29, 2006, 11:02:48 AM
Quote from: winrules on August 29, 2006, 09:56:17 AM
Umm can you try reuploading CustomAction.php?
Still the same error.
Try this version :)

;D Now it works. :D
Title: Re: Custom Action Mod
Post by: Techdomain on September 16, 2006, 08:11:31 AM
I use TP0.9.5, SMF 1.1rc3, and custom action 2.03, but when I add an action, it is just going back to the forum main page (when I click on the go to page link)

I have checked both of the files to see they uploaded properly, which they have. Any Ideas?
Title: Re: Custom Action Mod
Post by: mfKG on September 16, 2006, 07:42:46 PM
Nice Mode,....very useful,....better then the StaticPageMod (which anyway i wasnt able to install in v1.1rc3)
Much THX 4 this,...

My question: Is it possible to make the Edit (Input) Box wider (its a bit small, and there enough place;))?
(or where need i 2 seach?)

Title: Re: Custom Action Mod
Post by: winrules on September 16, 2006, 10:56:23 PM
Quote from: Techdomain on September 16, 2006, 08:11:31 AM
I use TP0.9.5, SMF 1.1rc3, and custom action 2.03, but when I add an action, it is just going back to the forum main page (when I click on the go to page link)

I have checked both of the files to see they uploaded properly, which they have. Any Ideas?
What URL does the link point to?


Quote from: mfKG on September 16, 2006, 07:42:46 PM
Nice Mode,....very useful,....better then the StaticPageMod (which anyway i wasnt able to install in v1.1rc3)
Much THX 4 this,...

My question: Is it possible to make the Edit (Input) Box wider (its a bit small, and there enough place;))?
(or where need i 2 seach?)


Not without changing more things than I want to.
Title: Re: Custom Action Mod
Post by: Techdomain on September 17, 2006, 03:01:22 AM
http://www.techdomain.com.au/index.php?action=staff

That one is a php, which I tested as an article Here (http://www.techdomain.com.au/index.php?page=30)

I also tried a html one and a bbc one (action=test and action=2) but no luck.

Edit: thanks for the quick reply btw :)
Title: Re: Custom Action Mod
Post by: winrules on September 17, 2006, 11:26:52 AM
Uhhh can you send me your index.php?
Title: Re: Custom Action Mod
Post by: Techdomain on September 17, 2006, 04:48:52 PM
 :o

This site continues to suprise... no attachments?

anyway, here is a link:

http://www.techdomain.com.au/index.php.zip

Title: Re: Custom Action Mod
Post by: winrules on September 17, 2006, 05:29:29 PM
Try replacing it with the attached file.

Only charter members and team members can attach files.
Title: Re: Custom Action Mod
Post by: Techdomain on September 17, 2006, 10:10:27 PM
Nice :) if you dont mind me asking - what did you do to it?

oh - it makes sense about the attachments also.

Thanks again  :)
Title: Re: Custom Action Mod
Post by: winrules on September 18, 2006, 05:43:16 PM
Quote from: Techdomain on September 17, 2006, 10:10:27 PM
Nice :) if you dont mind me asking - what did you do to it?

oh - it makes sense about the attachments also.

Thanks again  :)
For some reason the changes didn't get applied to that file. I just made the changes that the mod should've done when it was installed.
Title: Re: Custom Action Mod
Post by: Techdomain on September 18, 2006, 06:34:54 PM
Oh.. ok. I have found (since then) that I am having to go through every file when I upload a mod as nothing is changing. Something to do with safe mode on the server no doubt.
At any rate, it means I am learning a lot about PHP!
Title: Re: Custom Action Mod
Post by: PhatTyres on October 01, 2006, 09:21:53 PM
So,
If I wanted to add an action to open another webpage within my forum...

How would I code that in the code box?

Thanks in advance for Helping
Title: Re: Custom Action Mod
Post by: Pedja on October 02, 2006, 01:46:30 AM
This is excellent tool.

What about providing permissions for actions and option to set button for action in main menu, but not just that, how about being able to set button whenever action could be used, for instance, in user profile, in posts.. etc...?

I also would like to be able to set set description and keywords for HTML header for each custom action.

Title: Re: Custom Action Mod
Post by: winrules on October 02, 2006, 03:56:23 PM
Quote from: PhatTyres on October 01, 2006, 09:21:53 PM
So,
If I wanted to add an action to open another webpage within my forum...

How would I code that in the code box?

Thanks in advance for Helping
You can use a Iframe.


Quote from: Pedja on October 02, 2006, 01:46:30 AM
This is excellent tool.

What about providing permissions for actions and option to set button for action in main menu, but not just that, how about being able to set button whenever action could be used, for instance, in user profile, in posts.. etc...?

I also would like to be able to set set description and keywords for HTML header for each custom action.


You will have to edit the template to make a button right now.
Title: Re: Custom Action Mod
Post by: JunFan on October 16, 2006, 08:25:16 PM
I'd like to know what context that code comes into when executed from a custom action...

My action with which I have issue is http://councilofelders.net/index.php?action=apply (http://councilofelders.net/index.php?action=apply), I have a check that you must register to test it, but basically it posts a form up, you fill in the inputs and click submit.  The submit posts to http://councilofelders.net/index.php?action=apply2 (http://councilofelders.net/index.php?action=apply2)...another custom action.  I used to run this piece as a straight php file but I thought I'd get jiggy and turn it into a custom action...as I straight php file on the diskdrive of the server I was golden...all worked well.

My code in action=apply2 takes the form inputs from action=apply and formats them into a forum post and manually updates the database posting as a dummy user.  The idea here is to create posts in a board with very restricted visibility to a certain group of members on my site.  So the Application user is the author of the post. 

Now that I've made this action=apply2 I get the following error from my db update code:

Database Error
Table 'db180608952.messages' doesn't exist
File: /homepages/11/d1802342383/htdocs/hosts/councilofelders.net/www/Sources/Load.php(1708) : eval()'d code(9) : eval()'d code
Line: 102


The code for the first reference to the messages table is as follows:

// We've got the message, now post it and get its ID.
db_query("
INSERT INTO {$db_prefix}messages
(ID_BOARD, ID_MEMBER, subject, posterName, posterEmail, posterTime,
posterIP, smileysEnabled, body, icon)
VALUES ($board, $posterID, '$subject', '$posterName', '$posterEmail', " . time() . ",
'127.0.0.1', 0, '$message', 'xx')", __FILE__, __LINE__);
$ID_MSG = db_insert_id();


I'm requiring the inclusion of SSI.php and Subs-Post.php.  I'm not really sure why sticking this into a custom action instead of a file would kill the script.  Yes obviously I'm taking out the beginning and ending php tags that I'd have in normal php file.

Any thoughts?
Title: Re: Custom Action Mod
Post by: winrules on October 16, 2006, 09:06:43 PM
First you *shouldn't* have to include SSI.php as everything from there is defined (except the functions in it). With the problem, have you included $db_prefix in your globals? At the top of the code, just add this line:

global $db_prefix;
Title: Re: Custom Action Mod
Post by: JunFan on October 16, 2006, 10:14:00 PM
hrrm judging by the error it would appear that I'm getting the db prefix correctly it matches the database name.  I'll give it a shot and see what it does.

Thanks for the note.


EDIT: Bingo!  TYVM!
Title: Re: Custom Action Mod
Post by: RebelRose on October 23, 2006, 11:15:40 AM
Can you tell me what is wrong and/or how to fix these errors?


http://www.rebelrosenetworks.com/forum/index.php?action=mlist 
8: Undefined variable: groupname
File: /public_html/forum/Themes/default/CustomAction.template.php (eval?)
Line: 59

http://www.rebelrosenetworks.com/forum/index.php?action=mlist 
8: Undefined variable: groupname
File: /public_html/forum/Themes/default/CustomAction.template.php (eval?)
Line: 90

Title: Re: Custom Action Mod
Post by: winrules on October 23, 2006, 04:01:47 PM
That's an error in the code you put in for the page. If you post the code I might be able to help.
Title: Re: Custom Action Mod
Post by: RebelRose on October 23, 2006, 04:02:47 PM
Quote from: winrules on October 23, 2006, 04:01:47 PM
That's an error in the code you put in for the page. If you post the code I might be able to help.

The code for the mlist?
Title: Re: Custom Action Mod
Post by: winrules on October 23, 2006, 04:03:14 PM
Yeah the mlist action.
Title: Re: Custom Action Mod
Post by: RebelRose on October 23, 2006, 04:05:08 PM
Here it is


global $txt, $scripturl, $user_info;
global $context, $modSettings, $ID_MEMBER;
global $board_info, $settings, $db_prefix;

$groups_list = array(0, 20,14, );


        echo '<table align="center" width="95%" cellpadding="0" cellspacing="0"><tr>
                <td style="border-top: 2px solid #003366; border-bottom: 2px solid #003366; padding-top: 4px; "><center><h1>Meet All Our Members!!</h1></center></td></tr></table>';



foreach($groups_list as $groupnumber)
{

$loaded_ids = array();
    $user_profile=array();
    $memberContext=array();
    $profile=array();
    $context['TPortal']['team']=array();

// get the name of the group
$request = db_query("
                        SELECT groupName FROM {$db_prefix}membergroups WHERE ID_GROUP=$groupnumber", __FILE__, __LINE__);
if(mysql_num_rows($request)>0){
$row = mysql_fetch_row($request);
$groupname=$row[0];
mysql_free_result($request);
}


$select_columns = "
IFNULL(lo.logTime, 0) AS isOnline, IFNULL(a.ID_ATTACH, 0) AS ID_ATTACH, a.filename, a.attachmentType,
mem.personalText, mem.avatar, mem.ID_MEMBER, mem.memberName,
mem.realName,mem.lastLogin, mem.websiteTitle, mem.websiteUrl, mem.location,   
                        mem.posts,
                        them.value AS teamtext";
$select_tables = "
LEFT JOIN {$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN {$db_prefix}attachments AS a ON (a.ID_MEMBER = mem.ID_MEMBER)
                        LEFT JOIN {$db_prefix}themes AS them ON (mem.ID_MEMBER = them.ID_MEMBER AND them.variable = 'teamtext' AND them.ID_THEME=1)";

// Load the member's data.
$request = db_query("
SELECT$select_columns
FROM {$db_prefix}members AS mem$select_tables
WHERE mem.ID_GROUP = $groupnumber
                        ORDER BY mem.memberName ASC", __FILE__, __LINE__);
$new_loaded_ids = array();
while ($row = mysql_fetch_assoc($request))
{

$avatar_width = '';
$avatar_height = '';

$context['TPortal']['team'][] = array(
'username' => $row['memberName'],
'name' => $row['realName'],
'groupname' => $groupname,
'location' => $row['location'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $row['realName'] . '">' . $row['realName'] . '</a>',
'blurb' => $row['personalText'],
'avatar' => array(
'name' => $row['avatar'],
'image' => $row['avatar'] == '' ? ($row['ID_ATTACH'] > 0 ? '<img  src="' . (empty($row['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar2" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar2" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar2" border="0" />'),
'href' => $row['avatar'] == '' ? ($row['ID_ATTACH'] > 0 ? (empty($row['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar']),
'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar'])
),
'website' => array(
'title' => $row['websiteTitle'],
'url' => $row['websiteUrl']),
'online' => array(
'is_online' => $row['isOnline'],
'text' => &$txt[$row['isOnline'] ? 'online2' : 'online3'],
'image_href' => $settings['images_url'] . '/' . ($row['isOnline'] ? 'useron' : 'useroff') . '.gif',
),
'teamtext' => $row['teamtext'],
);


}
mysql_free_result($request);





echo '<table align="center" width="90%" cellpadding="0" cellspacing="0"><tr>
<td colspan="4" style="border-top: 2px solid #003366; padding-top: 4px; "><h4>' . $groupname . '</h4>
</td></tr><tr><td colspan="4"></td></tr><tr>';


        $newrow=0;
foreach($context['TPortal']['team'] as $team)
        {
            echo '
<td valign="top">'.$team['avatar']['image'].'</td>
<td valign="top" width="50%" class="middletext" style="padding: 2px;">
<h4 style="margin-top: 0; margin-top: 2px;">'.$team['link'].'</h4>
' , !empty($team['location']) ? '<b>Location</b>: '.$team['location'].'<br />' : '' , '
' , !empty($team['website']['title']) ? '<b>Website</b>: <a href="'.$team['website']['url'].'" target="_blank">'.$team['website']['title'].'</a><br />' : '' , '
' ,  $team['online']['is_online'] ? '<img src="'.$team['online']['image_href'].'" alt="" /> '.$team['online']['text'].'<br />' : $team['online']['text'].'<br />' , '

' , !empty($team['blurb']) ? '<i>- '.$team['blurb'].'</i><br />' : '' , '

' ,  !empty($team['teamtext']) ? $team['teamtext'].'<br />' : '' , '

    </div></td>';
            $newrow++;
            if($newrow>1){
               $newrow=0;
               echo '</tr><tr><td colspan="4"></td></tr><tr>';
            }
        }
echo '</tr></table>';
}
Title: Re: Custom Action Mod
Post by: winrules on October 23, 2006, 04:10:42 PM
Try this:

if(mysql_num_rows($request)>0){
$row = mysql_fetch_row($request);
$groupname=$row[0];
mysql_free_result($request);
}
else
$groupname = '';

Instead of

if(mysql_num_rows($request)>0){
$row = mysql_fetch_row($request);
$groupname=$row[0];
mysql_free_result($request);
}
Title: Re: Custom Action Mod
Post by: RebelRose on October 23, 2006, 04:12:46 PM
ok great thanks, I will go try it and if it stops the errors I want to say thank you now and if not I will be back.

Thanks
Title: Re: Custom Action Mod
Post by: RebelRose on October 23, 2006, 04:18:00 PM
Parse error: syntax error, unexpected '}' in /public_html/forum/Sources/Load.php(1711) : eval()'d code(9) : eval()'d code on line 120
Title: Re: Custom Action Mod
Post by: LeGaS on October 23, 2006, 04:18:48 PM
Try this:
if(mysql_num_rows($request)>0){
$row = mysql_fetch_row($request);
$groupname=$row[0];
mysql_free_result($request);
}
else {
$groupname = '';
        }
Title: Re: Custom Action Mod
Post by: RebelRose on October 23, 2006, 04:21:58 PM
Thank you LeGaS, that worked and so far no errors!!!
Title: Re: Custom Action Mod
Post by: lesmond on November 03, 2006, 05:48:05 PM
Great Mod winrules thanks I use it a lot :) Now for the question! can I make a custom action use specific theme i.e if my board is set to use the "SMF Default Theme"  can I make the mod use "Babylon Theme" instead, so that when I have made an action and I link to it that link goes to the "Babylon Theme" with that page.
Hope this makes sense  ???

Thanks Les
Title: Re: Custom Action Mod
Post by: winrules on November 03, 2006, 07:45:35 PM
Umm I don't think there's a way to that right now sorry.
Title: Re: Custom Action Mod
Post by: lesmond on November 03, 2006, 07:57:30 PM
ok  winrules thanks, its just that I have a shop on my site and I have it in a article (TinyPortal), so if people are viewing that page I cant see what they are doing in who's online

Les
Title: Re: Custom Action Mod
Post by: oneway on November 13, 2006, 12:57:14 AM
Winrules where does the Custom Action data get stored? Couldn't find a heading for it it in the database, or anywhere else I looked.

I use Custom Action all the time, it's great!
Title: Re: Custom Action Mod
Post by: winrules on November 13, 2006, 04:10:03 PM
It's in the settings table.
Title: Re: Custom Action Mod
Post by: markd on November 14, 2006, 11:14:01 AM
real fast: I see the php code to make sure the visitor is not a guest, but what would be the php code to limit the action to a specific membergroup?

or better yet, specific membergroups, like Groups A & B can't access, but Groups C, D, F, but not E can.

:)

thanx
-markd


Title: Re: Custom Action Mod
Post by: winrules on November 14, 2006, 05:10:21 PM

if (!in_array(array(1, 2, 3), $user_info['groups']) || in_array(array(4, 5, 5), $user_info['groups']))
fatal_error('You are not allowed to access this section.', false);

That would only allow the user to access the page if they are in group 1, 2, or 3, and not in groups 4, 5, or 6. Note that those are groups IDs, not names, and $user_info has to be in the global list.
Title: Re: Custom Action Mod
Post by: Isaac on November 22, 2006, 09:42:37 PM
Would it be possible to make it so the forum menu bar at the top is not displayed on the custom pages?
Title: Re: Custom Action Mod
Post by: winrules on November 22, 2006, 10:54:20 PM
Quote from: Isaac on November 22, 2006, 09:42:37 PM
Would it be possible to make it so the forum menu bar at the top is not displayed on the custom pages?
Do you mean the whole header and footer or just the list of buttons at the top?
Title: Re: Custom Action Mod
Post by: Isaac on November 23, 2006, 09:32:30 PM
Quote from: winrules on November 22, 2006, 10:54:20 PM
Quote from: Isaac on November 22, 2006, 09:42:37 PM
Would it be possible to make it so the forum menu bar at the top is not displayed on the custom pages?
Do you mean the whole header and footer or just the list of buttons at the top?
Just the list of buttons at the top, like [Home] [Search], etc.
Title: Re: Custom Action Mod
Post by: winrules on November 23, 2006, 09:58:16 PM
Hmm...that's a hard one. I guess you could do something like edit index.template.php. Find:

template_menu();

Replace With:

if (!in_array( $context['current_action'], array('myaction')))
template_menu();

Just replace 'myaction' with the name of your action. If you have more than one action you can put 'myaction', 'myaction2', 'ect'.
Title: Re: Custom Action Mod
Post by: Isaac on November 23, 2006, 10:07:49 PM
Works perfectly.  Thanks for the quick response, I really appreciate it.
Title: Re: Custom Action Mod
Post by: chougard on December 04, 2006, 12:20:43 AM
Can you please get this to work on SMF 1.1?
Title: Re: Custom Action Mod
Post by: RoarinRow on December 04, 2006, 05:51:37 PM
Quote from: chougard on December 04, 2006, 12:20:43 AM
Can you please get this to work on SMF 1.1?

Please   :D
Title: Re: Custom Action Mod
Post by: fedlerner on December 06, 2006, 08:47:30 AM
Yhea.. This is a really useful mod...
Come on winrules update it :D
Title: Re: Custom Action Mod
Post by: WarBirD on December 08, 2006, 05:11:31 PM
I need an updated version of this Mod or over half of my sitenavigation block that i made for TINY PORTAL is useless. When is the 1.1final compatible version out ?  :-[
Title: Re: Custom Action Mod
Post by: lesmond on December 08, 2006, 05:19:29 PM
If you unzip the Custom Action Mod on your local machine, open package-info.xml.
then find both instances of 1.1 RC3 and change to 1.1 save and close
zip it all up your done, tried in my site works fine.

Hope you don't mind  winrules :)
Title: Re: Custom Action Mod
Post by: WarBirD on December 08, 2006, 05:56:38 PM
I got it installed that way, but I don´t find the custom action in the admin where it was before.
It was in Features an Options, and now it isn´t. Thought the mod appeared to be installed fine. :( What now ?
Title: Re: Custom Action Mod
Post by: lesmond on December 08, 2006, 06:06:02 PM
did you install with the default theme?

Title: Re: Custom Action Mod
Post by: WarBirD on December 08, 2006, 06:10:30 PM
Now I get:

Quote
You cannot download or install new packages because the Packages directory or one of the files in it are not writable!

when I try to install it new. Though all files in that folder are 777, I can´t really make them more writable. :(
Title: Re: Custom Action Mod
Post by: winrules on December 09, 2006, 08:39:53 PM
Version 2.04 adds 1.1 Final compatibillity.
Title: Re: Custom Action Mod
Post by: rant-zone on December 14, 2006, 09:24:06 PM
 Have you given any more thought to expanding the code entry textarea?
Title: Re: Custom Action Mod
Post by: winrules on December 14, 2006, 09:26:27 PM
Quote from: rant-zone on December 14, 2006, 09:24:06 PM
Have you given any more thought to expanding the code entry textarea?
That would require modifing a lot of other things, which I'd rather not do. You can just make the code in another editor, and then paste it into the box.
Title: Re: Custom Action Mod
Post by: rant-zone on December 14, 2006, 10:00:26 PM
  Thanks for the reply winrules,
         That's what I've been doing, but I don't have apache, and php, and MySql running at home and to test a small modification requires re-uploading the new piece of code to my server.  All in all three programs running to add a period at the end of a sentence is a bit of a pain, but not as much of a pain as trying to track down the end of a sentence in a tiny window.  All in all a great mod. I wish I knew php, or whatever it is you code these mods in, this would totally rock with a few accessories added in. Like a couple of checkboxes to add a chunk of code (like the peice earlier in this thread to remove buttons.  One for the whole header would be good too) , to the file you were creating.  Anyway keep the great mods coming.

RZ
Title: Re: Custom Action Mod
Post by: Panzer- on December 31, 2006, 07:39:18 PM
Are you going to update this for 1.1.1 compatibility ?

I, and im sure others would like it if you did.
Title: Re: Custom Action Mod
Post by: guppy on December 31, 2006, 10:40:20 PM
The package for 1.1 works with 1.1.1 on my board.
Title: Re: Custom Action Mod
Post by: n0kS on January 04, 2007, 06:17:18 PM
I get this error with 1.1.1
Fatal error: Call to undefined function: customactionsettings() in public_html/forum/Sources/ModSettings.php on line 341

in these lines is this:

function ModifyActionSettings()
{
   global $sourcedir;
   require_once($sourcedir . '/CustomAction.php');
   CustomActionSettings();
}

any ideas?
Title: Re: Custom Action Mod
Post by: winrules on January 04, 2007, 06:21:32 PM
Can you reupload CustomAction.php in the mod package to the Sources directory? It looks like it didn't get uploaded correctly.
Title: Re: Custom Action Mod
Post by: clevername on January 10, 2007, 01:21:30 AM
I'm using 1.1.1 and my forum's package manager won't even let me download it (claims it's either corrupt or incompatible), any idea why?
Title: Re: Custom Action Mod
Post by: winrules on January 10, 2007, 08:16:01 PM
Where are you downloading it from?
Title: Re: Custom Action Mod
Post by: clevername on January 11, 2007, 02:40:02 AM
From the mods section of this site.
Title: Re: Custom Action Mod
Post by: nyxtyr on January 11, 2007, 09:27:47 PM
when i make a php page with just:

Test
PHP
Test
Test

and i get the following error: Parse error: syntax error, unexpected $end in /home/user/public_html/smf/Sources/Load.php(1724) : eval()'d code(9) : eval()'d code on line 1

then i tried:
Test
PhP
Test

^leaving the content/code box emtpy and i get no errors but when i add any text, code or anything in there i get errors
Title: Re: Custom Action Mod
Post by: winrules on January 12, 2007, 04:07:08 PM
clevername - Can you try unzipping it locally and see if you get any errors? It might just be a corrupt download.

nyxtyr - That's not valid PHP code. If you don't know PHP you will have to just use the HTML or BBC page types.
Title: Re: Custom Action Mod
Post by: clevername on January 13, 2007, 05:51:57 PM
Okay, I tried that.  No errors.  I'm totally stumped. :/
Title: Re: Custom Action Mod
Post by: winrules on January 13, 2007, 07:47:13 PM
Can you try redownloading th epackage?
Title: Re: Custom Action Mod
Post by: clevername on January 14, 2007, 02:08:38 AM
Okay, I tried that, and it's still telling me it's corrupted or incompatible.
Title: Re: Custom Action Mod
Post by: jalrock on January 24, 2007, 05:25:38 PM
I installed this mod. There were no errors. Now when I go to Featuers and Options I get this error
Fatal error: Cannot redeclare modifyactionsettings() (previously declared in forum/Sources/ModSettings.php:356) in
forum/Sources/ModSettings.php on line 362

I uninstalled the mod but still get the error.

Forum version: SMF 1.1.1

Mod Name Version 
1. SMF Arcade 1.3.0   [ Uninstall ] [ List Files ] [ Delete ] 
2. TinyPortal 0.97   [ List Files ] [ Delete ] 
3. SMF Links 1.6.3   [ Uninstall ] [ List Files ] [ Delete ] 
4. Googlebot & Spiders Mod 2.0.2   [ Uninstall ] [ List Files ] [ Delete ] 
5. SMF Achat ALPHA 0.2.0   [ Uninstall ] [ List Files ] [ Delete ] 
6. SMF 1.1.1 Update Package 1.1.1   [ Uninstall ] [ List Files ] [ Delete ] 
7. Users Online Today Mod 1.4.0   [ Uninstall ] [ List Files ] [ Delete ] 
8. SMF Gallery Lite 1.7.1   [ Uninstall ] [ List Files ] [ Delete ] 
9. SMF Archive 1.1   [ List Files ] [ Delete ] 
10. Custom Action Mod 2.04  [ Apply Mod ] [ List Files ] [ Delete ] 

Any help apreciated
Title: Re: Custom Action Mod
Post by: jalrock on January 24, 2007, 06:07:33 PM
nevermind I fixed it. Script hung and repeated mod 6 times
Title: Re: Custom Action Mod
Post by: codenaught on January 24, 2007, 06:43:26 PM
Quote from: clevername on January 14, 2007, 02:08:38 AM
Okay, I tried that, and it's still telling me it's corrupted or incompatible.
Odd, did you by any chance remove the version number from the Powered By line of your forum? Do you have problems with other packages?
Title: Re: Custom Action Mod
Post by: jalrock on January 24, 2007, 08:27:54 PM
QuoteOdd, did you by any chance remove the version number from the Powered By line of your forum?

Nope its always been there. http://www.friendlyjungle.com/forum/

QuoteDo you have problems with other packages?


Nope I have several others installed and they worked like a champ.

I wrote a custom mod for Member Pages but it does not touch any of the same files.

Thanks for answering but again I corrected the error and all is well now.

Title: Re: Custom Action Mod
Post by: Rivers on January 25, 2007, 12:58:39 AM
Works for me! Thanks very much, nice addition to the infrastructure. After some tweaking I was able to execute ad hoc inline sql queries and output the result sets within the smf framework. We're using joomla and orstio's bridge BTW
Title: Re: Custom Action Mod
Post by: Simplemachines Cowboy on February 02, 2007, 11:21:18 PM
SMF 1.1.1
Mods:
1.     EmailFlash      2.0       [ Uninstall ]  [ List Files ]  [ Delete ]
2.    FlashChat Integration    0.1 Beta    [ Uninstall ] [ List Files ] [ Delete ]
3.    Custom Action Mod    2.04    [ Uninstall ] [ List Files ] [ Delete ]
4.    Spell Check Custom Words    1.0.1    [ Uninstall ] [ List Files ] [ Delete ]
5.    Googlebot & Spiders Mod    2.0.2    [ Uninstall ] [ List Files ] [ Delete ]
6.    Global Announcements    1.0    [ Uninstall ] [ List Files ] [ Delete ]
7.    FontandSizeDropdown1.1    1.1    [ Uninstall ] [ List Files ] [ Delete ]

Got a weird thing I just noticed.
No errors in any error log, forum or server.

I created a custom action, using the mod, to a plain jane html page full of links, and I created a new tab for the default theme, called "Links", which works like it's suppose to.
Everything works fine, except, when I click on the "Profile" tab (none of the others do this), the text in the "Links" tab changes to say "Reset Form".  ???
The tab stays clickable, and takes you to the proper page.

Any ideas whare that comes from?
Title: Re: Custom Action Mod
Post by: Simplemachines Cowboy on February 06, 2007, 01:31:45 PM
Ideas on my previous post?

Anybody?

Bueller?  :P
Title: Re: Custom Action Mod
Post by: mohoganybrwn on February 07, 2007, 12:24:17 PM
Hello! Great mod.  But I have a problem.
I was recommended to use this mod to show all my members awards on one page.
I'm confused on how I would do this... could anyone help me?

I want to show "Awards" in the main menu...and I would like that "awards" page to show all the members that recieved awards for the month... could anyone help me out? I'm so lost.

Thank u.
Title: Re: Custom Action Mod
Post by: kat on February 11, 2007, 10:32:13 AM
OK. I've obviously made a complete hash of this.

I wanted to make a single button to access the theme-changer page.

I created an action and called it "ThemeChanger". Original, huh?

I made the "Type" php.

I made the page title "ThemeChanger". I'm high on originality, as you can tell.

In the "Code" box, I added:

http://www.tlakoc.org.uk/index.php?action=ThemeChanger

Thing is, I'm getting "Parse error: syntax error, unexpected ':' in /home/tlakoco/public_html/Sources/Load.php(1724) : eval()'d code(9) : eval()'d code on line 1"

I'm confused, as you might imagine...
Title: Re: Custom Action Mod
Post by: drossman on February 17, 2007, 08:32:05 PM
Can anyone give me an example of how to access a custom profile field from inside a custom action ??  8)
Title: Re: Custom Action Mod
Post by: drossman on February 17, 2007, 09:39:47 PM
I figured it out...

global $sourcedir;
$p_id=$_GET['u'];

require($sourcedir . '/Profile.php');

loadThemeOptions($p_id);

echo "CP1 = " . $context['member']['options']['CP1'];
Title: Re: Custom Action Mod
Post by: khoking on February 28, 2007, 02:13:01 AM
I just installed this mod on SMF 1.1.2 but it shows the error below when I click on Features and Options in admin.

Fatal error: Cannot redeclare modifyactionsettings() (previously declared in /home/leica/public_html/Sources/ModSettings.php:345) in /home/leica/public_html/Sources/ModSettings.php on line 351

Any idea why?
Title: Re: Custom Action Mod
Post by: Kettu on February 28, 2007, 05:17:30 AM
Quote from: khoking on February 28, 2007, 02:13:01 AM
I just installed this mod on SMF 1.1.2 but it shows the error below when I click on Features and Options in admin.

Fatal error: Cannot redeclare modifyactionsettings() (previously declared in /home/leica/public_html/Sources/ModSettings.php:345) in /home/leica/public_html/Sources/ModSettings.php on line 351

Any idea why?
Cannot redeclare often means that a code is doubled. Check the files if there is some of the code double added.
Title: Re: Custom Action Mod
Post by: khoking on February 28, 2007, 08:30:52 AM
Thanks! Corrected :)
Title: Re: Custom Action Mod
Post by: choloman05 on March 06, 2007, 11:27:11 PM
I just wanted to say that this is a GREAt mod winrules. Thanks so much for doing this for us! This really adds a lot more flexibility to the forum and I really appreciate it.  :thumbsup:
Title: Re: Custom Action Mod
Post by: slugg on March 13, 2007, 04:40:47 AM
Quote from: winrules on May 20, 2006, 05:49:18 PM
Quote from: uberjon on May 20, 2006, 04:59:16 PM
seems i found a small bug in the action mod :;(

when i try to copy alot of html into the box it does it just fine but when i save it it deletes the last part to make it all fit or somethig :S
just ignore the content in this just to show u how long it is :P

er... nvm wont let me post
QuoteThe following error or errors occurred while posting this message:
The message exceeds the maximum allowed length (65530 characters).

it works well in a program i am using to help me with the html.. but it deletes part of it when i try to use it :'(

can u fix this?
It's not a bug, it's that the database column is a TEXT column, which limits the data to 65535 characters. If you want to use this mod with a something longer than that, you will have to set the "value" column in the settings table to MEDIUMTEXT or LONGTEXT.

Hello and thank you for your great work with this mod.

I'm fairly new to all this so I don't understand how to implement your above suggestion.  I am also running into the text limit issue.  Could you please explain to me what exactly I need to do to apply your quote above and what files and code to look for that need to be changed? 

Thanks
Title: Re: Custom Action Mod
Post by: kat on March 24, 2007, 12:04:19 PM
I thought this'd be useful to make a single, one-click link to the theme change page.

I've tried putting:

http://www.tlakoc.org.uk/index.php?action=theme;sa=pick;u=1;sesc=8fa8a3d0734ebbfc98f1e4cd8f195874

in the "Code" box. That's obviously stoopid, though, because of sessions and things.

Anyone know what I SHOULD be putting in there, please?
Title: Re: Custom Action Mod
Post by: Kettu on March 24, 2007, 02:17:39 PM
You can use .../index.php?action=profile;sa=theme.
Title: Re: Custom Action Mod
Post by: kat on March 24, 2007, 02:25:22 PM
I'll give it a try.

Thanks!
Title: Re: Custom Action Mod
Post by: kat on March 24, 2007, 02:27:11 PM
Oh, dear.

That gives me:

Parse error: syntax error, unexpected ':' in /home/tlakoco/public_html/Sources/Load.php(1734) : eval()'d code(9) : eval()'d code on line 1

THAT, I didn't expect...  
Title: Re: Custom Action Mod
Post by: Kettu on March 24, 2007, 04:57:45 PM
What have you added exactly?
Title: Re: Custom Action Mod
Post by: kat on March 24, 2007, 05:12:39 PM
Just what you typed.

I tried it with "sa=theme" as a sub-action, too.

Got the same error.
Title: Re: Custom Action Mod
Post by: Kettu on March 25, 2007, 05:26:13 AM
Quote from: kat on March 24, 2007, 05:12:39 PM
Just what you typed.

I tried it with "sa=theme" as a sub-action, too.

Got the same error.
With the ...? Or did you change it to your board address?
Title: Re: Custom Action Mod
Post by: kat on March 25, 2007, 09:09:32 AM
Sorry...

Yeah. My board's address, naturally. Odd that the error's coming from load.php, innit?
Title: Re: Custom Action Mod
Post by: Kettu on March 26, 2007, 01:37:52 AM
I don't know. Check you own profile at your board and copy the link under "Design & Layout" or similar. Have German activated here. This is the link you should use.
Title: Re: Custom Action Mod
Post by: kat on March 26, 2007, 05:11:35 AM
This one?

http://www.tlakoc.org.uk/index.php?action=theme;sa=pick;u=1;sesc=78abb52ab60b3ca3fec7d89a2a8ba3b4

That gives me "Session timed out" errors, because of the session ID.
Title: Re: Custom Action Mod
Post by: Kettu on March 26, 2007, 11:45:01 AM
Quote from: kat on March 26, 2007, 05:11:35 AM
This one?

http://www.tlakoc.org.uk/index.php?action=theme;sa=pick;u=1;sesc=78abb52ab60b3ca3fec7d89a2a8ba3b4

That gives me "Session timed out" errors, because of the session ID.
No! That one. Take a look at the picture.
Title: Re: Custom Action Mod
Post by: kat on March 26, 2007, 04:19:42 PM
With you!

I'm getting that load.php error, with that.

Parse error: syntax error, unexpected ':' in /home/tlakoco/public_html/Sources/Load.php(1734) : eval()'d code(9) : eval()'d code on line 1

which I find rather peculiar, to be honest.
Title: Re: Custom Action Mod
Post by: Kettu on March 27, 2007, 07:38:44 AM
How do you include it at Custom Action Mod?
Title: Re: Custom Action Mod
Post by: kat on March 27, 2007, 10:27:11 AM
Name: ThemeChanger

Type: php

Page Title: ThemeChanger

Code: http://www.tlakoc.org.uk/index.php?action=profile;u=1;sa=theme

Title: Re: Custom Action Mod
Post by: Kettu on March 27, 2007, 01:04:40 PM
Quote from: kat on March 27, 2007, 10:27:11 AM
Code: http://www.tlakoc.org.uk/index.php?action=profile;u=1;sa=theme
Yes, ofcourse it makes an error. There is the user defined. Change the link to
http://www.tlakoc.org.uk/index.php?action=profile;sa=theme
Title: Re: Custom Action Mod
Post by: kat on March 27, 2007, 01:17:25 PM
I'd thought it was down to that. Session ID causing the problems, I suspect.

Problem is, I'm still getting:

Parse error: syntax error, unexpected ':' in /home/tlakoco/public_html/Sources/Load.php(1734) : eval()'d code(9) : eval()'d code on line 1

Which I find most odd.
Title: Re: Custom Action Mod
Post by: Kettu on March 28, 2007, 05:20:51 AM
Did you already include links through custom action mod?
Title: Re: Custom Action Mod
Post by: kat on March 28, 2007, 08:00:50 AM
If I make a clickable link, in the way you described, it works, fine.

For some odd reason, though, using exactly the same link, as a "Custom action" gives that error.

Most odd, huh?
Title: Re: Custom Action Mod
Post by: Kettu on March 28, 2007, 10:45:05 AM
I am not familiar with the code of the Custom Action Mod, but I think that it is caused by it. Maybe if you make a php code frame around the link. I think the : from http:// causes the error.
Title: Re: Custom Action Mod
Post by: kat on March 28, 2007, 10:46:19 AM
I'm extremely grateful for the help you've given me, Kettu.

I'll give it a go and let you know how it goes.
Title: Re: Custom Action Mod
Post by: guppy on April 04, 2007, 12:24:44 PM
Quote from: kat on February 11, 2007, 10:32:13 AM
I made the "Type" php.

I made the page title "ThemeChanger". I'm high on originality, as you can tell.

In the "Code" box, I added:

http://www.tlakoc.org.uk/index.php?action=ThemeChanger




echo 'http://www.tlakoc.org.uk/index.php?action=ThemeChanger';



suggest u use bbc instead of php


[url]http://www.tlakoc.org.uk/index.php?action=ThemeChanger[/url]


Title: Re: Custom Action Mod
Post by: guppy on April 04, 2007, 12:34:09 PM
Great mod  ;)

I'm using it with the SSI Single Message mod (http://custom.simplemachines.org/mods/index.php?mod=357) cos' it's easier to work on an editor :) With little changes to how the grabbed message is to be displayed, custom mod helps me to show whatever content I have on one of my forum post. The 2 worked really great for me.

One question, or rather, a suggestion.. To add treelink so that the custom page can look uniform. Forum Name > Custom Page Title.

Cheers!
Title: Re: Custom Action Mod
Post by: htmlmaster on April 10, 2007, 04:46:10 PM
Great mod, but I'm stuck on one part. Could someone help me attach an RSS feed to the custom action page so it displays content? I've tried doing stuff like this before without the custom action page (I normally use a PHP include), but when I put the code on a custom action page, I get this error:
Quote
Parse error: syntax error, unexpected '<' in /home/nerdcoun/public_html/forum/Sources/Load.php(1726) : eval()'d code(9) : eval()'d code on line 1

If it helps, I'm using this feed: http://nerdcouncil.com/blog/?feed=rss2

Thanks!
Title: Re: Custom Action Mod
Post by: Darkorical on April 11, 2007, 02:28:08 AM
is it possible to use a frame on a custom action page to access an outside php script so it would run the entire script inside a frame on the 1 custom page? something like


<frameset rows="*,*"" frameborder="NO" border="1" framespacing="0">
  <frame src="http://mysite.com/index.php" name="mainFrame">
</frameset>
Title: Re: Custom Action Mod
Post by: MiCCAS on April 11, 2007, 02:32:59 AM
Maybe use the PHP option then use PHP include
Title: Re: Custom Action Mod
Post by: Darkorical on April 11, 2007, 03:08:38 AM
well it kinda worked ... it showed the page .. but the php generated links took me back to the main page of the site


any other ideas?
Title: Re: Custom Action Mod
Post by: guppy on April 11, 2007, 11:07:38 AM
Quote from: htmlmaster on April 10, 2007, 04:46:10 PM
Great mod, but I'm stuck on one part. Could someone help me attach an RSS feed to the custom action page so it displays content? I've tried doing stuff like this before without the custom action page (I normally use a PHP include), but when I put the code on a custom action page, I get this error:
Quote

Parse error: syntax error, unexpected '<' in /home/nerdcoun/public_html/forum/Sources/Load.php(1726) : eval()'d code(9) : eval()'d code on line 1

If it helps, I'm using this feed: http://nerdcouncil.com/blog/?feed=rss2

Thanks!

maybe you could post your code here so that we can take a look..
Title: Re: Custom Action Mod
Post by: guppy on April 11, 2007, 12:00:42 PM
Quote from: Darkorical on April 11, 2007, 03:08:38 AM
well it kinda worked ... it showed the page .. but the php generated links took me back to the main page of the site


any other ideas?

I've tried with an iframe and have no problem. Same thing, what code did u use?
Title: Re: Custom Action Mod
Post by: Darkorical on April 11, 2007, 12:40:05 PM
Memo to self Don't Code at 2 am.

Where <frameset> and <frame src> failed Iframe worked beautifully. Thank you
Title: Re: Custom Action Mod
Post by: htmlmaster on April 11, 2007, 07:33:52 PM
Here's all I have:

<?php include("http://www.nerdcouncil.com/testrss.php"); ?>
[/quote]
And I put that right on the custom action page code area, it's on PHP too.
Title: Re: Custom Action Mod
Post by: guppy on April 12, 2007, 09:13:03 AM
htmlmaster,

You don't have to put the php tags, just use

include("http://www.nerdcouncil.com/testrss.php");

or put the (testrss.php) php code into the custom page code box directly (without <?php & ?>).
Title: Re: Custom Action Mod
Post by: htmlmaster on April 13, 2007, 06:58:57 PM
Yay! it worked! Thank you so much!
Title: Making a Blog using Custom Action Mod
Post by: spottedhog on April 20, 2007, 12:28:34 PM
I have been thinking about how to use the Custom Action Mod to create a simple blog using SSI.  My thought is to create something that has 2 parts; a blog list and actually showing the blog.  My concept is to make a Blog Board, and make it so Regular Members can post topics, but only reply to their own topic.

OK....  The 1st part, making the blog list, is pretty straight forward by modifying the ssi_boardNews.  I am thinking I could call the modified ssi as:  ssi_blogList.  Then the 1st Custom Action would be:

<div>ssi_blogList();</div>

This could be the link to a Blog button on the template menu.

I am thinking the 2nd Custom Action could be a slightly modified version of ssi_topics or ssi_topicNews.

2nd Custom Action:

<div>ssi_singleBlog($ID_TOPIC);   <---- $ID_TOPIC from the previous Custom Action created link

Question #1.  For the URL from the Blog List created by the 1st Custom Action, how can I get it to go to the specific ID_TOPIC for the ssi_topics/ssi_topicNews so it shows up in the 2nd Custom Action?

In other words, I know I can put:  ?action=singleBlog (if that is the name of the 2nd Custom Action), but how do I code it to do that?   maybe:  ?action=singleBlog;sa=555   where 555 = the topic ID from the link created in the Blog List?

Question #2.  Will the contents displayed by the Custom Action follow the style.css?

In other words, if I placed additional items in the stylesheet for example in a "div":

#blog {border: 10px ridge navy; margin:10px; padding:10px 100px 10px 100px}

Will the contents accept and display this?

<div id="blog">  allll blog content   </div>

thanks in advance....
Title: Re: Custom Action Mod
Post by: spottedhog on April 20, 2007, 01:55:19 PM
I think I answered Question #2.  It should work just fine using the theme's style.css.

soooo, back to Question #1.....

Can I take something like this from the New Comment of the Topics-Replies mod:

'new_comment' => '<a href="' . $scripturl . '?action=post;topic=' . $row['ID_TOPIC'] . '.' . $row['numReplies'] . '">' . $txt['smf_news_3'] . '</a>',


and replace:

?action=post;topic=

with something like this?:

?action=singleBlog;topic=

Would the Topic ID variable be transferred to the ssi_singleBlog(); in the 2nd Custom Action or Sub Action?

thanks....
Title: Re: Custom Action Mod
Post by: spottedhog on April 21, 2007, 01:30:23 AM
....just did some rough testing and what I proposed above works!!!  woohoo!

one interesting thing was I had to require SSI.php to use the ssi_boardNews, for example.

At least it is able to use style.css

Nice work on the Mod!
Title: Re: Custom Action Mod
Post by: SRaven on April 22, 2007, 03:14:39 PM
Hi, can someone tell me how to get frames to work in this?

I added this to the field:

Quote<html>
<head>   
</head>
<frameset rows="10%,*" border="0">
    <frame name="title" src="title.html">
        <frameset cols="40%,*" border="0">
        <frame name="menu" src="menu.html">
        <frame name="content" src="content.html">
    </frameset>
</frameset>
<body>
</body>
</html>

And created the title.html, menu.html and content.html files and put them in the correct place, But after I save the action and view the page, it didn't output anything..

Any ideas?
Title: Re: Custom Action Mod
Post by: SRaven on April 23, 2007, 02:00:13 PM
Anyone? :-\
Title: Re: Custom Action Mod
Post by: spottedhog on April 23, 2007, 05:44:57 PM
did you try it without the html, head, and body tags?
Title: Re: Custom Action Mod
Post by: SRaven on April 23, 2007, 07:11:29 PM
Yes I did, same result... :(
Title: Re: Custom Action Mod
Post by: Tick on April 23, 2007, 10:23:08 PM
<center><iframe
src ="http://link to the  page you want to display"
width="90%" height="500" scrolling="no">
</iframe></center>


YOu can do it this way.  Just edit the above code to your liking
Title: Re: Custom Action Mod
Post by: SRaven on April 24, 2007, 12:53:26 AM
Thanks, but that doesn't work for what I need to do.
I need a 3 part layout, like the frame code in my other post indicated.

Not just one page displayed. 3 files make up this page.  the code I used works,(as you can see from the pic) I just can't get it to work for custom action mod.   :-\

Pic of how it should look is attatched.
Title: Re: Custom Action Mod
Post by: guppy on April 24, 2007, 10:12:30 AM
Save your code as your_file_name.html

<html>
<head>   
</head>
<frameset rows="10%,*" border="0">
    <frame name="title" src="title.html">
        <frameset cols="40%,*" border="0">
        <frame name="menu" src="menu.html">
        <frame name="content" src="content.html">
    </frameset>
</frameset>
<body>
</body>
</html>


create a html custom page and point tick's code to your_file_name.html

<center><iframe
src ="you_file_name.html"
width="90%" height="500" scrolling="no">
</iframe></center>


place all the html files to the base directory where smf resides or point to the full url of the files.
Title: Re: Custom Action Mod
Post by: spottedhog on April 24, 2007, 12:11:52 PM
I have been looking/testing and I think I see some of your problem here...... SMF does not like the html tags of frameset and frame. I think it is because of XHTML Strict DTD does not allow them.

Here is a work around and could give you something nearly as good using the "iframe" tag.

If your desired end result is to have the SMF header and footer display with your code in the middle, then this is a way to do it. One advantage of this method is that you can get around that darn small textarea input box in Custom Actions Mod. :)

Overview: We will create a new template file and place it in the Themes/default directory. Name it whatever..... for example: yourcodename.template.php Then we will create a Custom Action which calls to load that specific template.....; <----- very little coding there. :)

OK... Let's do it! (using your html filenames...)

Create the template file:

<?php

echo 
'Hey! This is Your Template! <br /><br />';
echo '<div>';
include ('title.html');
echo '</div><div>';
echo '<iframe width="100%" height="500px" src="content.html"></iframe></div>';

?>


Save that file as: yourfilenamehere.template.php

Upload that file to the Theme/default directory.

In Custom Acitons put:
loadTemplate('yourfilenamehere');

Make sure you save the Custom Action as a PHP file.

****NOTE: only put the template name here. leave off the .template.php

One thing you would have to do different is to place the menu.html file at the top of your content.html file if you are wanting other pages to load within the iframe.

Using the Custom Actions Mod this way, by creating template files to display the desired Contents seems to be a nice way of enhancing a site.
Title: Re: Custom Action Mod
Post by: SRaven on April 25, 2007, 07:52:20 PM
Quote from: iwyen on April 24, 2007, 10:12:30 AM
Save your code as your_file_name.html

<html>
<head>   
</head>
<frameset rows="10%,*" border="0">
    <frame name="title" src="title.html">
        <frameset cols="40%,*" border="0">
        <frame name="menu" src="menu.html">
        <frame name="content" src="content.html">
    </frameset>
</frameset>
<body>
</body>
</html>


create a html custom page and point tick's code to your_file_name.html

<center><iframe
src ="you_file_name.html"
width="90%" height="500" scrolling="no">
</iframe></center>


place all the html files to the base directory where smf resides or point to the full url of the files.

That worked like a charm, thanks!


@Spottedhog- Thanks for the suggestion, I like that idea and might just do that for some other pages that I'll be making, thanks!
Title: Re: Custom Action Mod
Post by: breezie on April 27, 2007, 06:05:45 AM
what directory does this mod need installed into, I installed it and get an error page when I try to link to it.
Title: Re: Custom Action Mod
Post by: TrueSatan on April 27, 2007, 06:42:07 AM
Quote from: breezie on April 27, 2007, 06:05:45 AM
what directory does this mod need installed into, I installed it and get an error page when I try to link to it.

Please read http://docs.simplemachines.org/index.php?board=49.0;sort=subject (http://docs.simplemachines.org/index.php?board=49.0;sort=subject)
Title: Re: Custom Action Mod
Post by: tribalost on May 01, 2007, 03:14:24 PM
can anyone help me... im looking for a code to check if your a guest?
then returns echo '<font size=36 color=#ffffff>YOU NEED TO LOGIN BEFOR YOU SEE THE PAGE!!!</font>;
Title: Re: Custom Action Mod
Post by: guppy on May 02, 2007, 08:04:50 PM
Sounds like a feature for the mod :)

if ($context['user']['is_guest'])
echo 'bla bla';
else
echo 'bla bla bla';

Title: Re: Custom Action Mod
Post by: derjensen on May 31, 2007, 01:20:13 PM
I get also an error - installed via PackageManager. "Cannot install mod..." SMF, Ver. 1.1.2. Can anyone give a hint!?
Title: Re: Custom Action Mod
Post by: SMdot™ on June 02, 2007, 07:58:11 PM
Okay for some reason I'm getting text that says Custom Action when I go to my Features and Options... but I don't even have that mod installed =( how can I get rid of this link?
Title: Re: Custom Action Mod
Post by: Sharr76 on June 05, 2007, 06:34:21 AM
Hi,

could someone help mw with this problem?

[url][http://www.simplemachines.org/community/index.php?topic=161925.0/url]

Thanks  :)
Title: Re: Custom Action Mod
Post by: guppy on June 05, 2007, 11:13:20 AM
Quote from: Sharr76 on June 05, 2007, 06:34:21 AM
Hi,

could someone help mw with this problem?

http://www.simplemachines.org/community/index.php?topic=161925.0 (http://www.simplemachines.org/community/index.php?topic=161925.0)

Thanks  :)

What is the HTML code you added?
Title: Re: Custom Action Mod
Post by: Sharr76 on June 07, 2007, 11:44:57 AM
 iwyen

I installed this mod:

http://custom.simplemachines.org/mods/index.php?mod=331 (http://custom.simplemachines.org/mods/index.php?mod=331)

Title: Re: Custom Action Mod
Post by: Niteblade on June 29, 2007, 07:52:34 PM
I know this installed on 1.1.3, but I didn't see any place to input my values..

1.1.3 ...  ;D
Title: Re: Custom Action Mod
Post by: PoLlama on July 05, 2007, 12:11:17 PM
Maybe you should rename this mod to 'Custom Pages'. Its really not given credit for how useful it is. Just my opinion.
Title: Re: Custom Action Mod
Post by: digit on July 21, 2007, 09:12:56 AM
I agree...   this is a GREAT mod.
Title: Re: Custom Action Mod
Post by: PoLlama on July 28, 2007, 03:30:28 PM
Should really be integrated with SMF... why not? This mod applies to everyone, it doesn't use extra resources.
Title: Re: Custom Action Mod
Post by: John S on August 09, 2007, 01:55:35 AM
hey, i installed the mod it was all successful but nothing shows up in 'features and options'...
Title: Re: Custom Action Mod
Post by: Monniemoo on August 13, 2007, 02:12:40 PM
I've really been wanting to make more actions, and this mod really helped ^_^

One problem: I have links to all the sub-actions in the main actions, and when I click them, it says in the top URL of the web page that it went to the sub-action, but the page didn't change like it's supposed to. Anyone know how to fix this?

((click here (http://dollcon.troublebubble.org/index.php?action=link) and click one of the things under Navigation if you have no idea what I'm talking about))
Title: Re: Custom Action Mod
Post by: John S on August 13, 2007, 06:31:32 PM
Quote from: John S on August 09, 2007, 01:55:35 AM
hey, i installed the mod it was all successful but nothing shows up in 'features and options'...

perhaps i should uninstall and reinstall it?

i get this error:

   Type     Action     Description
1.    Delete File    ./Sources/CustomAction.php    
2.    Delete File    ./Themes/default/CustomAction.template.php    
3.    Execute Modification    ./Sources/ModSettings.php    Test failed
4.    Execute Modification    ./index.php    Test failed

why does the test fail?

i tried to do a package parser on this mod and it doesnt work.. hmm.. how do i know if everything that's supposed to be in the 'features and options' area installed?
Title: Re: Custom Action Mod
Post by: Monniemoo on August 14, 2007, 08:21:46 AM
Well, I'm certainly not an expert on this stuff, but I can attempt to help you by saying...

Usually when tests fail (at least for me), it's because the mod does not work on the version of SMF that you have. Not entirely sure if that's your problem, though...
Title: Re: Custom Action Mod
Post by: Farmacija on August 14, 2007, 09:14:00 AM
when i try to put php code page like a custm action i got this error
QuoteParse error: parse error, unexpected '<' in c:\program files\easyphp1-7\www\novo\Sources\Load.php(1735) : eval()'d code(9) : eval()'d code on line 1
Title: Re: Custom Action Mod
Post by: Niteblade on August 14, 2007, 01:16:06 PM
I'm using a php 301 redirect for my custom action... and it works...


header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.newdomain.com/newpage/newurl.htm");
exit();


Now, my question is regarding the SSI action that creates the menu bar.


<?php ssi_menubar(); ?>


In index.template.php, I have created an additional link for this custom action. Say, for example that the custom action is titled "mall".


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



Now when someone visits the "mall" I would like the "Mall Button" in the menubar to indicate that they are indeed in the mall.

Is there anything I'm missing in index.template.php that would prevent the change in the background for the active mall tab?

Thanks.
Title: Re: Custom Action Mod
Post by: Scubasteve on August 19, 2007, 11:38:16 PM
Quote from: Farmacija on August 14, 2007, 09:14:00 AM
when i try to put php code page like a custm action i got this error
QuoteParse error: parse error, unexpected '<' in c:\program files\easyphp1-7\www\novo\Sources\Load.php(1735) : eval()'d code(9) : eval()'d code on line 1

Make sure when you enter the php code you remove the php tags. they are added automatically for you.
Title: Re: Custom Action Mod
Post by: Farmacija on August 20, 2007, 10:24:00 PM
yes i figure it. :)
for other members-there isn't need to put <?php for the start of php file in custom action field :)
Title: Re: Custom Action Mod
Post by: King Steph1 on August 26, 2007, 11:45:33 AM
I need to align something to the center of the page on a php page but it gives this error:
Parse error: syntax error, unexpected '<' in /home/sk8erdud/public_html/da/Sources/Load.php(1726) : eval()'d code(9) : eval()'d code on line 1
Title: Re: Custom Action Mod
Post by: ssgcmwatson on August 27, 2007, 01:49:39 AM
Ok, php/smf newbie with a question....

I'd like to create BBC tag(s) that will access the public mimetex server....let's call the tags [math] & [/math]....

[math]  ~LaTex code~  [/math]

will get automagically translated into

[ img ] http://www.url.com/mimetex.cgi?~LaTeX code~ [ /img ]


I'm not sure how to fill in the fields to create this kind of action.  Any help is appreciated.

Thanks!
Chris
Title: Re: Custom Action Mod
Post by: Paracelsus on August 27, 2007, 04:24:06 AM
Just wondering...

To what kind of "actions" do you usually use this MOD for? Just trying to realise the potential and gather some fresh and interesting ideas to develop. ;D
Title: Re: Custom Action Mod
Post by: Monniemoo on September 07, 2007, 04:41:58 PM
Quote from: Monniemoo on August 13, 2007, 02:12:40 PM
I've really been wanting to make more actions, and this mod really helped ^_^

One problem: I have links to all the sub-actions in the main actions, and when I click them, it says in the top URL of the web page that it went to the sub-action, but the page didn't change like it's supposed to. Anyone know how to fix this?

((click here (http://dollcon.troublebubble.org/index.php?action=link) and click one of the things under Navigation if you have no idea what I'm talking about))

Really, I need this ASAP. I have a credits link page in this, and until I solve this problem I'm technically not giving all needed credit. (still giving SMF credit, but not other credit)
Title: Re: Custom Action Mod
Post by: winrules on September 08, 2007, 10:33:31 PM
It's ";sa=" not ";do=".
Title: Re: Custom Action Mod
Post by: Jyggafey on September 09, 2007, 08:35:28 AM
hi, i got a center block (using tinyportal) that redirects to my custom action under certain circumstances (user is logged in and a custom profile field is not set when visiting the forum index).
Im using redirectexit($scripturl.'/index.php?action=myaction'); to redirect.
When i visit my action by directly accessing the url it works like a charm, however when the user is redirected by the center block code the user is not logged in anymore when reaching my action.
Heres my center block code:
<-snip->
problem solved: dont use full url in redirectexit() just redirectexit('action=myaction')
Title: Re: Custom Action Mod
Post by: Monniemoo on September 14, 2007, 05:36:32 PM
Quote from: winrules on September 08, 2007, 10:33:31 PM
It's ";sa=" not ";do=".

Thank you ^_^
Title: Re: Custom Action Mod
Post by: Marook on September 28, 2007, 11:59:45 PM
Hi @ all,

first : its a great mod ;)

I want to integrate a foreign script, its a small link directory. I'd did it before using the custom action mod by making the changes by hand (index.php). But i got some ugly errors ;) So i decided to try it with the custom action mod. I copied the script named xlinks into the boarddir and created a new action with on line of php in it.


require ('xlinks/index.php');


i also tried it with include() but if i try to open the custom page there are serval errors. I think because of the include path but im unable to fix this. If i run the script by opening it directly in the browser, there are no errors.
The error is this one :

Quote
Fatal error: require() [function.require]: Failed opening required './config.php' (include_path='.;\xampp\php\pear\') in E:\xampp\htdocs\smf\xlinks\include\head.php on line 59

Line 59 of head.php is :

require('./config.php');


I also tried to change the path to ./xlinks/config.php and i got the same error on another line number. After a changed all includes() or require() paths i will get a blank site with no errors. What im gonna do now ??
Title: Re: Custom Action Mod
Post by: mattrat on September 30, 2007, 12:33:23 PM
I have read through the 13 pages of this thread.........

I am also a newbie at this. My question is how do I install the mod?

I have index.php action array with 'customaction' => array('CustomAction.php', 'CustomAction'),

I have put CustomAction.php into Sources

I have put customaction.template.php into Themes/default

What do I do with modification.xml, movemodsettings.xml and package-info.xml?
Title: Re: Custom Action Mod
Post by: falguni1 on October 01, 2007, 07:30:02 AM
how to make custom action
Title: Re: Custom Action Mod
Post by: Marook on October 01, 2007, 04:42:28 PM
Ok i solved the problem by using an iframe with no borders, so im able to display the forum header and the other script below the menu.
Title: Re: Custom Action Mod
Post by: John S on October 19, 2007, 01:51:42 AM
I have Google Adsense search on my smf forum.

I created a page through 'Action Mod':
http://www.mysite.com/index.php?google

I've followed the wizard from Google Adsense.

I get this code, which i inserted into action mod page HTML:
Code:

<!-- Google Search Result Snippet Begins -->
<div id="googleSearchUnitIframe"></div>

<script type="text/javascript">
   var googleSearchIframeName = 'googleSearchUnitIframe';
   var googleSearchFrameWidth = 700;
   var googleSearchFrameborder = 0 ;
   var googleSearchDomain = 'www.google.com.au';
</script>
<script type="text/javascript"
         src="http://www.google.com/afsonline/show_afs_search.js">
</script>
<!-- Google Search Result Snippet Ends -->



When I try the Google Search function It doesn't work it redirects me to the same page?
Title: Re: Custom Action Mod
Post by: Darkness_ on November 05, 2007, 07:02:08 PM
Fatal error: Cannot redeclare template_main() (previously declared in C:\Documents and Settings\dark\Bureaublad\Nieuwe map (2)\Sources\Load.php(1726) : eval()'d code:7) in C:\Documents and Settings\dark\Bureaublad\Nieuwe map (2)\Sources\Load.php(1726) : eval()'d code(9) : eval()'d code on line 417

I get this when I place a code in it (it is nou running on a server on my pc (wampserver)
Could you help me?
Title: Re: Custom Action Mod
Post by: eleven0 on November 06, 2007, 08:51:35 PM
Does this work with 1.1.4?
Title: Re: Custom Action Mod
Post by: RogueDOC on November 10, 2007, 11:18:33 AM
 I'm trying to create a "portal" type page. I'm using HTML for the layout and SSI PHP for stuff like "Recent Post". My question is there way to use HTML and PHP to create a custom action?
Title: Re: Custom Action Mod
Post by: PrizeLive.com on November 19, 2007, 11:54:54 PM
Does this work for version 1.1.4?
Title: Re: Custom Action Mod
Post by: Marook on November 20, 2007, 02:03:24 PM
Yeah it does ;) works fine in my forum
http://www.marook-online.de/smf/index.php?action=xlinks
for example...
Title: Re: Custom Action Mod
Post by: tsmalmbe on November 21, 2007, 05:32:35 AM
Can I give permission to certain users/groups to use this, or is it only for administrators?
Title: Re: Custom Action Mod
Post by: tsmalmbe on November 21, 2007, 12:47:56 PM
If  I  make an action using PHP, what do I need to do to get mysql-queries to work?
Title: Re: Custom Action Mod
Post by: Marook on November 21, 2007, 04:29:34 PM
No you can't give permissions, but can verify the membergroup in your custom action code... you can use db_query() to do sql queries, pls refer to the online documentation.
Title: Re: Custom Action Mod
Post by: tsmalmbe on November 21, 2007, 06:17:10 PM
Yes I realized that I can perform mysql-queries just as normal. Although, it behaves a little wierd, it does work. How about getting parameters,  there's no convenience-array I could use, I will have to parse the request directly, right?

Oh, regarding the mysql-queries. I now initialize a new connection. I copied that part directly from the SSI.php. But is this necessary? Initializing a conn  requires  me to put usernams and passwords  in my custom action, which is not nice.

Title: Re: Custom Action Mod
Post by: Marook on November 21, 2007, 08:41:50 PM
No you dont need to initialize a new connection, just do the queries... just take a look at the docs (http://docs.simplemachines.org/)
Title: Re: Custom Action Mod
Post by: tsmalmbe on November 22, 2007, 04:30:13 AM
Well... really, finding out what I can and cannot do with Custom Actions is not really revealed in the docs. What you are trying to say is, it is business as usual, right? I can call any functions declared in subs (as long as they subs are included that is), do any sql:ing, and so forth.
Title: Re: Custom Action Mod
Post by: Marook on November 22, 2007, 06:34:59 AM
Yepp ;) Maybe sometimes you must use global [$varname] to get access to different vars... for example, i used the $language variable, which is stored in $_SESSION['language'] to display different parts of my custom actions in the same language, the user or guest has choosed... Its also possible to display the linktree above your custom action... SMF is great !!!
Title: Re: Custom Action Mod
Post by: ibizara on December 11, 2007, 08:11:40 AM
Hi,

Please could someone give me some guidance on how to do the below code with a db_query() ??

Many Thanks,
ibizara

<?php
require_once('SSI.php');

$allowed_groups = array(19);
$can_see FALSE;
foreach (
$allowed_groups as $allowed)

if (
in_array($allowed$user_info['groups'])){
$can_see TRUE;
break;
}

if (
$can_see){
echo (
'access granted');
}

else{
echo (
'access denied');
}

?>
Title: Re: Custom Action Mod
Post by: falguni1 on December 14, 2007, 06:45:51 AM
I want to create a php action

if user is logged in
then show his own post

how to write the code I dont know wot code is needed to get this action
Title: Re: Custom Action Mod
Post by: digit on December 14, 2007, 08:31:53 AM
hmm, I don't think you can set permissions with this mod -  unfortunately!  ;)
Title: Re: Custom Action Mod
Post by: falguni1 on December 15, 2007, 05:34:08 AM
ok

as we have the mod we want some php snippets to use

so can anyone create some snippets or ideas to be used in this mod.
Title: Re: Custom Action Mod
Post by: digit on December 15, 2007, 05:06:45 PM
Using the customaction mod, is there a way to do this?



<a href="', $scripturl, '?action=profile;u=', $ID_MEMBER, ';sa=showPosts"><img border="0" src="',$settings['images_url'],'/usercp/kedit.png" width="80" height="80"></a>



If I try JUST that I get the error....

Parse error: syntax error, unexpected '<' in /Sources/Load.php(1748) : eval()'d code(9) : eval()'d code on line 1

Is it possible to get the smf variables?

Thanks in advance.

Title: Re: Custom Action Mod
Post by: ibizara on December 17, 2007, 08:57:47 AM
Whenever I got¬
Parse error: syntax error, unexpected '<' in /Sources/Load.php(1748) : eval()'d code(9) : eval()'d code on line 1

I just created everything on a seprate page and seems to work better...

include_once("./custom/index.php");
Title: Re: Custom Action Mod
Post by: falguni1 on December 18, 2007, 01:20:10 AM
Quote from: ibizara on December 17, 2007, 08:57:47 AM
Whenever I got¬
Parse error: syntax error, unexpected '<' in /Sources/Load.php(1748) : eval()'d code(9) : eval()'d code on line 1

I just created everything on a seprate page and seems to work better...

include_once("./custom/index.php");

wot is the complete code you are using can u please give us.
Title: Re: Custom Action Mod
Post by: ibizara on December 18, 2007, 07:24:28 AM
That is all the code... just include a page rather than put code into the custom textarea.
I found it works alot better and gets rid of the error you had below (or it did for me anyway).

s1.png Custom Action Code
s2.png /custom/top.php
s3.png /custom/index.php

(s4.png - My setup with a submenu)
Title: Re: Custom Action Mod
Post by: falguni1 on December 21, 2007, 05:57:43 AM
can some one give post some php snippets to use with mod.
Title: Re: Custom Action Mod
Post by: avepeachy on January 03, 2008, 04:00:33 PM
I've used this mod with some success on my site. The problem is that the pages only show up in Firefox. None of my members viewing in IE can see the html pages. Is anyone else having this problem? WOuld someone be willing to help me try and fix this?

Thanks in advance!
Title: Re: Custom Action Mod
Post by: ibizara on January 24, 2008, 11:03:36 AM
Just different ways to link external pages...

include("./custom/link.php");
echo'<IFRAME width=100% marginwidth=0 marginheight=0 frameborder=0 SRC="/custom/link.html"></IFRAME>';

Quote from: falguni1 on December 21, 2007, 05:57:43 AM
can some one give post some php snippets to use with mod.
Title: Re: Custom Action Mod
Post by: falguni1 on January 24, 2008, 12:01:21 PM
Quote from: ibizara on January 24, 2008, 11:03:36 AM
Just different ways to link external pages...

include("./custom/link.php");
echo'<IFRAME width=100% marginwidth=0 marginheight=0 frameborder=0 SRC="/custom/link.html"></IFRAME>';

Quote from: falguni1 on December 21, 2007, 05:57:43 AM
can some one give post some php snippets to use with mod.
thanks.
Title: Re: Custom Action Mod
Post by: Darkorical on February 12, 2008, 11:11:17 AM
alright I've read this thread and looked for other information and am comming up empty handed so Ill ask here

I am using Ultimate FTP to place a FTPish up-loader on my site it has a .js file with it that you are supposed to reference via
<script language="javascript" src="uftplite.js"></script>
I tried changing the src = to the full address of the site I keep getting a box but the applet failes to load Im building locally so unfortunatly I cannot show you whats going on so I just hope that this is not too confusing

alright Im still having issues but I think I got that one figureed out ... the .js file has inside of it the size definitions ofr the applet when I changed them the box that comes up changes so I am actually seeing .js file so it must be something else with the file Ill work it out later. thanks anyway
Title: Re: Custom Action Mod
Post by: mobious74 on March 05, 2008, 01:28:48 AM
Quote from: winrules on May 19, 2006, 03:51:54 PM
With the error messages, In the code you added for the button, $txt[rules] should be $txt['rules'].

Thank you winrules...was going crazy for a bit...stupid apostrophes.....;)
Title: Re: Custom Action Mod
Post by: worm82075 on March 17, 2008, 08:47:48 AM
Awesome Mod, works like a charm, so I have no problem with it's function, my question is about it's use.

Ok, I have archived another site and what I'm working with is about 370 static html pages with css formating. I can see the ability to add the existing code to custom actions editing all links to point to those actions there by integrating the static set into my 1.1.4 SMF forum and it acting as it did before accept it will be surrounded by my header and footer. Ok, that is nearly perfect except I don't want to let guests have access to those actions. From what I've gathered from this thread is that making the action Php rather than Html will give me the ability to put a user check in every action. While I am fairly proficient with html I am not very familiar with  Php as of yet. I have a deadline to meet on the construction of my site otherwise I would just be learning Php and doing this on my own.

My question is this, Is it possible for me to create the action as php, giving me my user check and then have it parse Html code to construct the page. Or alternatively is there a program available that can convert my html code to php.

Any help concerning the possession and regulation of standard html code by SMF would be appreciated. From what I gathered so far in the past 24 hours scouring this site for anything related to this subject is all the solutions in involve transforming my html code to php. Alright well there you have it, I'm sure someone here can enlighten me as to all my options so I can then decide what the best course of action will be.

Thanks.
Jeremy aka Worm

EDIT:I have located a program to convert my html to php and it works!

So all I really need now is a snipet to place at the beginning of my code to dis allow guests.

EDIT 2:ok, I managed to scrounge the first part and it works right
if ($context['user']['is_guest'])
echo "You <FONT color=#ff0000><b>MUST</b></FONT> be a registered member of this site to enter this archive.<BR><BR><BR>";
else


i just need to be able to kill it at this point if guest checks true

EDIT 3: Well that didn't take much time
if ($context['user']['is_guest'])
die('Direct Access to this location is not allowed.');
else


I have been at this site at least a half a dozen times for help. This is the first time I actually posted thinking what i needed wasn't here. Just took me a little longer to find it this time thats all. Leave it to a bunch of forum creators to set the example of how to run a tight ship. Thanks
Title: Re: Custom Action Mod
Post by: ameo on March 18, 2008, 06:24:56 AM
This is one of the best mods ever. Saved me so much time. Thank U.
Title: Re: Custom Action Mod
Post by: winrules on March 18, 2008, 03:53:46 PM
I've added a new version that supports 2.0. It included permission control for each action (so you can set whether certain members can view a custom action) and the option to show a button on the main menu for the action.
Title: Re: Custom Action Mod
Post by: PfalzNacht on March 18, 2008, 09:09:48 PM
Thx for updating this great Mod.  ;)

But i have one Problem:

in English everything's ok, but when i translate it into german and put it into managesettings.german.php, nothing happens.
The mod still works, but i haven't any text.

Can you please help me.  O:)

Should i give you the german translation?
Title: Re: Custom Action Mod
Post by: winrules on March 18, 2008, 09:31:58 PM
Are you using the SMF 1.1 or the SMF 2.0 version? If you are using the SMF 2.0 version make sure you have cleared the cache in Admin -> Maintenence -> Forum Maintenence -> Common Tasks.
Title: Re: Custom Action Mod
Post by: PfalzNacht on March 19, 2008, 07:01:28 AM
I use 2.0, but only to test.
Title: Re: Custom Action Mod
Post by: JoshieDaMan on March 22, 2008, 03:52:38 AM
I am trying custom 3.0. I install the package, then I clicked "apply' and it showed up blank page when I clicked "apply".

It looks like install.php is blank.

Before if you asked me to uninstall the previous version of this mod, I did and even deleted the folder from of it.
Title: Re: Custom Action Mod
Post by: JoshieDaMan on March 23, 2008, 09:47:03 PM
Bump.
Title: Re: Custom Action Mod
Post by: winrules on March 24, 2008, 03:42:44 PM
What SMF version are you using? Do you notice any errors in your error log?
Title: Re: Custom Action Mod
Post by: JoshieDaMan on March 24, 2008, 06:15:35 PM
Quote from: winrules on March 24, 2008, 03:42:44 PM
What SMF version are you using? Do you notice any errors in your error log?
1.1.4 of course.

It shouldn't be errors. I mean it can't show it as a errors because when I click "apply" after I installed the package in package manager. Ten I clicked "apply" and it took me a page of blank where it should say "success/failed" but it didn't so it took me to a blank page and other packages don't do something like that.
Title: Re: Custom Action Mod
Post by: winrules on March 24, 2008, 06:19:53 PM
3.0 only works on SMF 2.0. You need to use 2.04.
Title: Re: Custom Action Mod
Post by: JoshieDaMan on March 25, 2008, 08:24:26 AM
Yeah, that's what I have. Thanks!
Title: Re: Custom Action Mod
Post by: 58tbird on March 26, 2008, 11:06:16 PM
I guess I posted this on the wrong board:
http://www.simplemachines.org/community/index.php?topic=230762.msg1483865#msg1483865 (http://www.simplemachines.org/community/index.php?topic=230762.msg1483865#msg1483865)

I'm trying to put something like Google Alert results in my forum.  I think I'm getting close to what I need but I need some help.

I signed up for Google's Ajax Search API, and created a News Bar using the search terms I want it to return results for. 

Then, I downloaded and installed the Custom Action Mod.  I created a page and pasted Google's code into the mod pane.  I clicked on "go to page" and there it was in all it's glory!

My two problems are:

1. The page includes my list of search terms right at the top of the page in a cluster.  I need those to be hidden.  I can locate them in Google's code, but I think if I delete them, the search won't operate.  I tried deleting them, and it won't function.  However, I didn't realize that those terms are hyperlinks which, when selected, change the results.  So, I guess there's no way around having them displayed.

2. I need to create a way for members to locate this page either by a Tab, or by a separate board, but I don't know how to do that.

PM me if you want a link to see what I'm talking about.

I appreciate any help you can provide. :)
Title: Re: Custom Action Mod
Post by: winrules on March 27, 2008, 04:08:57 PM
As far as #2, assuming you are using SMF 1.1 you can create new tabs with this tutorial: http://docs.simplemachines.org/index.php?topic=564
Title: Re: Custom Action Mod
Post by: 58tbird on March 29, 2008, 10:11:23 AM
Thank you winrules!  I appreciate the tip.  I implemented the instructions you referred to and successfully added a new tab, however, all it does is return me to my main page.  I think I'm missing something that links the new tab to the action I added using the Custom Action Mod.

I successfully created the page I want using the Custom Action Mod here (http://auditbible.com/index.php?action=News), but the only way to access it is to click the "Go to Page" link on the Custom Action Settings.

How can I make the new tab link to this page so it can be easily accessed by members and visitors?
Title: Re: Custom Action Mod
Post by: ameo on March 29, 2008, 04:00:26 PM
winrules, does this support ajax/php script?
I'm trying to make a custom page that contains shoutbox, which is uploaded to my localhost,
but since shoutbox contains ajax and php, it doesn't load, at all.

any advice - what am I doing wrong?

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="http://www.coldfusion.ej.am/yshout5/example/css/dark.yshout.css" />
<link rel="stylesheet" href="styles.css" type="text/css" />
<script type="text/javascript" src="highslide/highslide.packed.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>yShout</title>
</head>

<body>

<style type="text/css">
body
</style>

<!-- Begin Shout Box Code -->
<script src="http://www.coldfusion.ej.am/yshout5/js/jquery.js" type="text/javascript"></script>

<script src="www.coldfusion.ej.am/yshout5/js/yshout.js" type="text/javascript"></script>
<script type="text/javascript">
   new YShout({
    yPath: '/yshout5'
});
</script>
<div id="yshout"></div>
<div align="center">
  <p>
    <!-- End Shout Box Code -->

  </p>

</div>
</body>

</html>
Title: Re: Custom Action Mod
Post by: winrules on March 29, 2008, 04:01:37 PM
Make sure you have the link right like this:

<a href="', $scripturl, '?action=News">News</a>




ameo - Since you need to add code to the html headers that will not work in version 2.04 (for SMF 1.1). However it will work in 3.0 (for SMF 2.0 Beta 3 Public).
Title: Re: Custom Action Mod
Post by: ameo on March 29, 2008, 04:24:21 PM
I see. Thank you. So the same thing will work in SMF 2.0 beta?
Could maybe this be modified to work in SMF 1.1.4 or not?
Title: Re: Custom Action Mod
Post by: winrules on March 29, 2008, 04:29:34 PM
I guess you could do something like after this in CustomAction.php:
$context['page_title'] = $title;
Adding this:

if ($context['current_action'] == 'News')
$context['html_headers'] .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="http://www.coldfusion.ej.am/yshout5/example/css/dark.yshout.css" />
<link rel="stylesheet" href="styles.css" type="text/css" />
<script type="text/javascript" src="highslide/highslide.packed.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';

And putting the rest of your script (everything from <body> to </body>) in the code box in the admin panel.
Title: Re: Custom Action Mod
Post by: 58tbird on March 29, 2008, 04:32:33 PM
Quote from: winrules on March 29, 2008, 04:01:37 PM
Make sure you have the link right like this:

<a href="', $scripturl, '?action=News">News</a>

Thank you winrules - I really appreciate all your help on this and other issues I've had.  I double checked and, yes, I had the right code for the link. 

Meanwhile, I installed the Website Button Mod and it links to the url for the page I created using the Custom Action Mod.  I think I'll stay with that solution for now.
Title: Re: Custom Action Mod
Post by: billsaysthis on April 03, 2008, 03:34:34 PM
I'm using 3.0 with SMF 2.0 beta. Other CAM pages work as expected but now I'm trying to experiment with ssi_recentPosts and cannot get it to work.

Page type is PHP

Source File Code block is only:
require(dirname(__FILE__) . '/SSI.php');

Template Code is only:
ssi_recentPosts();

I tried adding echo before the ssi_recentPosts call but that didn't help.

Any suggestions on this?
Title: Re: Custom Action Mod
Post by: winrules on April 03, 2008, 04:09:14 PM
Do you get any errors or is it just that nothing shows up?
Title: Re: Custom Action Mod
Post by: billsaysthis on April 03, 2008, 04:35:39 PM
if I put echo before the function I get a blank page; otherwise my normal templates print (to the screen) right to the point where the CAM template kick in, then there is no more HTML.
Title: Re: Custom Action Mod
Post by: winrules on April 04, 2008, 10:23:00 PM
In the source file code put this instead:

global $boarddir;
require($boarddir . '/SSI.php');


Since the file that is executing that code is actually in the sources directory __FILE__ will be in the sources directory. So "(dirname(__FILE__) . '/SSI.php')" would look for SSI.php in the sources directory instead of the board directory where it really is.
Title: Re: Custom Action Mod
Post by: billsaysthis on April 07, 2008, 03:12:01 PM
Worked, thanks!
Title: Re: Custom Action Mod
Post by: JoshieDaMan on April 10, 2008, 07:32:00 PM
Parse error: syntax error, unexpected '<' in /home/public_html/Sources/Load.php(1853) : eval()'d code(9) : eval()'d code on line 1

:(
Title: Re: Custom Action Mod
Post by: jimvy on April 11, 2008, 08:52:13 PM
Here's what I need but I don't know how to get it:

When someone puts [player]player name[/player] I need to have it search my database for player name, then find the player ID number and make the [player]player name[/player] a link
[url=http://en18.tribalwars.net/page.php?page=inbound&screen=info_player&id=player ID]player name[/url]

id=player ID should be whatever the player ID is.

Can someone help me figure out how to do this?
Title: Re: Custom Action Mod
Post by: cleanfiles on April 19, 2008, 06:20:36 PM
Quote from: worm82075 on March 17, 2008, 08:47:48 AM
Awesome Mod, works like a charm, so I have no problem with it's function, my question is about it's use.

Ok, I have archived another site and what I'm working with is about 370 static html pages with css formating. I can see the ability to add the existing code to custom actions editing all links to point to those actions there by integrating the static set into my 1.1.4 SMF forum and it acting as it did before accept it will be surrounded by my header and footer. Ok, that is nearly perfect except I don't want to let guests have access to those actions. From what I've gathered from this thread is that making the action Php rather than Html will give me the ability to put a user check in every action. While I am fairly proficient with html I am not very familiar with  Php as of yet. I have a deadline to meet on the construction of my site otherwise I would just be learning Php and doing this on my own.

My question is this, Is it possible for me to create the action as php, giving me my user check and then have it parse Html code to construct the page. Or alternatively is there a program available that can convert my html code to php.

Any help concerning the possession and regulation of standard html code by SMF would be appreciated. From what I gathered so far in the past 24 hours scouring this site for anything related to this subject is all the solutions in involve transforming my html code to php. Alright well there you have it, I'm sure someone here can enlighten me as to all my options so I can then decide what the best course of action will be.

Thanks.
Jeremy aka Worm

EDIT:I have located a program to convert my html to php and it works!

So all I really need now is a snipet to place at the beginning of my code to dis allow guests.

EDIT 2:ok, I managed to scrounge the first part and it works right
if ($context['user']['is_guest'])
echo "You <FONT color=#ff0000><b>MUST</b></FONT> be a registered member of this site to enter this archive.<BR><BR><BR>";
else


i just need to be able to kill it at this point if guest checks true

EDIT 3: Well that didn't take much time
if ($context['user']['is_guest'])
die('Direct Access to this location is not allowed.');
else


I have been at this site at least a half a dozen times for help. This is the first time I actually posted thinking what i needed wasn't here. Just took me a little longer to find it this time thats all. Leave it to a bunch of forum creators to set the example of how to run a tight ship. Thanks

Your post helped me a lot, thank you for all your hard work tracking this info down and posting it in this thread...Well done.
Title: Re: Custom Action Mod
Post by: Nibogo on April 19, 2008, 07:36:02 PM
i try a simple php code and nothing appear in the action , what i can do?
Title: Re: Custom Action Mod
Post by: winrules on April 19, 2008, 07:50:17 PM
Quote from: NIBOGO on April 19, 2008, 07:36:02 PM
i try a simple php code and nothing appear in the action , what i can do?
Can you post the code you used here?
Title: Re: Custom Action Mod
Post by: H3 Skillz on April 23, 2008, 01:51:10 PM
Hi, I scimmed through the entire topic and couldn't find the answer to this question so I'm going to ask it, if it's already been answered, I appoligize:

Where are the custom actions stored?  That is, when I create a custom action, I know how to view it and everything.  However, right now, my site is getting huge parse errors everywhere (I think it is because of my host) so I am going to move to a different host that doesn't mess with your files.  Unfortunately, right now I can't login or anything because of the errors so is there a place in the MySQL database where I can find all of the code for all of the custom actions I had?  I had a lot of custom actions and it would take days to restore all of them so where is this data located?  Thanks in advance!
Title: Re: Custom Action Mod
Post by: winrules on April 23, 2008, 03:24:19 PM
If you are using SMF 1.1 they are stored in the settings table in the database. If you are using SMF 2.0 they are stored in the custom_actions table.
Title: Re: Custom Action Mod
Post by: H3 Skillz on April 23, 2008, 06:47:06 PM
Cool, I found it, sorry for forgetting to say my version number (which is 1.1.4 which may be needed for my next question)  I have one more question.  I noticed that often times when you try to "restore" a forum (not restore the entire database but just restore the users or all of the posts or some other aspect, it doesn't really work all the time.  For example, when you recover the smf_members table, glitches pop up in the total number of members and everything until you change the most recent member id.  Will this same kind of effect happen when I recover all of the custom actions related variables and values from my smf_settings table?  That is, if I back up all of those custom actions now (by just backing up the variable and value for the title, code, name, and type of each), is there anything in another table (or somewhere else in smf_settings) that I have to backup as well for it to work correctly on a totally new installation when I restore it?
Title: Re: Custom Action Mod
Post by: Enders on May 07, 2008, 02:51:41 AM
Is there a way to allow specific members to edit this section as well>? Also, how do you stop the center block for tinyportal from showing in the custom actions?
Title: Re: Custom Action Mod
Post by: JamesD01 on May 11, 2008, 04:31:03 PM
I currently have SMF 2.0 beta 3.0 installed, with the mod installed on it.

Can I update my SMF 2.0 Beta 3 forum to SMF 2.0 Beta 3.1 and will the Mod work??

many thanks, and a great mod!
Title: Re: Custom Action Mod
Post by: tylerabell on May 16, 2008, 01:12:26 AM
when i make a php page then go to the page i get the following error...
Parse error: syntax error, unexpected $end in /home/sites/forgeguide.com/public_html/Sources/Load.php(1747) : eval()'d code(9) : eval()'d code on line 1
Title: Re: Custom Action Mod
Post by: Atheo on May 16, 2008, 01:45:37 PM
<newb>

OK.  I'm not sure if this is a question for this topic or not but I have to ask.  I am able to use the mod fine.  What I want to do, though, is to change the 'home' button so that it links to my custom page.  I am using smf 2.

Please help.
Thanks!

</newb>
Title: Re: Custom Action Mod
Post by: Marcus Forsberg on May 17, 2008, 09:35:51 AM
Why ain't v3.0 avabile for 1.1.4?   :'( :'( :'(
Title: Re: Custom Action Mod
Post by: New Earth on May 20, 2008, 09:59:52 PM
How can I get all the TinyPortal blocks to show up on one of my custom pages?

Thank you.
Title: Re: Custom Action Mod
Post by: werderfan on May 21, 2008, 02:49:57 PM
anyone tested in 1.1.5?

mod site says only for 1.1.4 but because most of the mods then also run in 1.1.5, I tested but always get a parse error in the .xml files  ::)
Title: Re: Custom Action Mod
Post by: ruaduck on May 21, 2008, 03:07:22 PM
I have it up in my 1.1.5 forums. works great for me.
Title: Re: Custom Action Mod
Post by: werderfan on May 22, 2008, 08:39:44 AM
now it works

had to upload a new temp file in the packages and then it worked well :D
Title: Re: Custom Action Mod
Post by: yume_kokoro on May 29, 2008, 03:29:52 PM
Just wanted to say a big Thanks! for making this fantastic mod.  ;D

I can't even begin to tell you how much added functionality this has given to my site.

Installed on SMF 1.1.5 - with absolutely no trouble.
Title: Re: Custom Action Mod
Post by: Atheo on June 02, 2008, 10:30:13 AM
Hi,  I am able to make the action just fine but what I need is to have that action listed in the visibility options so that I can place a Tiny Portal Block there by itself. 

i.e.   custom action = "Chat"




Actions:
Display on all pages and sections
Front page
Forum
Recent
Show unread
Unread replies
Profile
My Messages

**Chat**
Calendar
Admin
Login
Logout
Register
Post
Stats
Search
Memberlist

Is this possible?

Also, how do I delete the actions menu tab after  deleting an action...do I have to do this manually in index.template?
Title: Re: Custom Action Mod
Post by: fangweile on June 08, 2008, 03:40:10 AM
Can I use this to add a custom action for my coppermine gallery. I want to add an action "gallery" that links to my coppermine index without breaking the action url.
Title: Re: Custom Action Mod
Post by: mattrat on June 12, 2008, 06:43:17 AM
I have installed this mod on version 1.1.5. The install went fine with no errors.

When I go to Features/Custom Actions I get a blank page.
Title: Re: Custom Action Mod
Post by: digit on June 15, 2008, 12:52:33 PM
Quote from: winrules on April 23, 2008, 03:24:19 PM
If you are using SMF 1.1 they are stored in the settings table in the database. If you are using SMF 2.0 they are stored in the custom_actions table.

It'd be cool if that were true in 1.1 too.  Any chance of an upgrade? :)  I would hate to somehow crash my settings table. (I'm dealing with a lot of actions)

While I'm tossing things around ;)  I would also like to see - in the admin area....   just a list of actions,  linked to the individual action forms...  instead of having all the actions editable from one big page.

Thanks for a great mod.

digit




Title: Pls help me !!
Post by: alblove on June 20, 2008, 06:23:20 PM
When i add a php action it shows this error ...

Parse error: syntax error, unexpected '<' in /home/alblove/public_html/forum/Sources/Load.php(1726) : eval()'d code(9) : eval()'d code on line 1

Can someone help me ?
Title: Re: Custom Action Mod
Post by: dtommy79 on June 29, 2008, 01:02:19 PM
Hi,

How can I translate this mod?
Title: Re: Custom Action Mod
Post by: digit on July 07, 2008, 02:29:35 AM
Hey Winrules.....

In the admin area, where we have the list of actions, how would I add the current custom action name to the html?  I have a lot of actions, and it's hard finding any of them, since I can not search for text in an input box.  I would like to hit control-f and find the actions.

See attachment - notice the text in red....

Thanks again for my favorite mod!    :D
Title: Re: Custom Action Mod
Post by: jani01 on July 09, 2008, 05:54:55 AM
I have just installed this Mod and when I tried to go in Admin Section following message appeared, 

Fatal error: Cannot redeclare template_show_custom_action() (previously declared in C:\Inetpub\vhosts\lahorerang.com\httpdocs\Sources\Load.php(1859) : eval()'d code:1965) in C:\Inetpub\vhosts\lahorerang.com\httpdocs\Sources\Load.php(1859) : eval()'d code on line 2106

Forum Name is


www.Lahorerang.com (http://www.lahorerang.com)

Please Tell me How I can Fix this problem 

Thanks

Waiting
Title: Re: Custom Action Mod
Post by: Elrond on July 15, 2008, 10:30:36 AM
Very, very good work, WinRules. This is definitely one that I enjoy using, a lot!

There is a modification I'm working on for it that seems to be working well - adding stylesheets that are correctly served as text/css. I did the same thing with my TinyPortal installation several months ago, for blocks and articles. It's a modification to the root index.php (simply adding the css action in), then a new function in CustomAction.php, using the same functions that the .xml action uses to avoid the attempt to find a template. The new function in mine is called CustomActionCSS. This applies only to the SMF 1.1.x installation for this mod and not the SMF 2.0 version. But code is free to give out so here it is! (Be aware that errors may happen if my installation instructions weren't as clear as perhaps they should be lol). :P

Sources/CustomAction.php:

Add function to any area of the file, just not before <?php or ?>, or inside another function. That would be bad. Anywhere in between the tags and outside of a function will do.
// Parse this action's stylesheet!!!
function CustomActionCSS()
{
    global $context, $modSettings;

    ob_end_clean();
    if (!empty($modSettings['enableCompressedOutput']))
        @ob_start('ob_gzhandler');
    else
        ob_start();

    header('Content-type: text/css');
    if(!empty($_REQUEST['action']) && $_REQUEST['action'] == 'css')
    {
        if(isset($modSettings['CA' . $_REQUEST['style'] . '_css']))
        {
            echo $modSettings['CA' . $_REQUEST['style'] . '_css'];
        }
        else
        {
            echo '';
        }
        if (isset($_REQUEST['substyle']))
        {
            if(!empty($modSettings['CA' . $_REQUEST['style'] . '_sa' . $_REQUEST['substyle'] . '_css']))
                echo $modSettings['CA' . $_REQUEST['style'] . '_sa' . $_REQUEST['substyle'] . '_css'];
            else
                echo '';
        }
    }
    obExit(false);
}


index.php:

Find:
        'cleanperms' => array('Admin.php', 'CleanupPermissions'),


Add:
        'css' => array('CustomAction.php', 'CustomActionCSS'),


Sources/Subs.php:

Find:
function setupThemeContext()
{
    global $boarddir, $db_prefix, $modSettings, $user_info, $scripturl, $context, $settings, $options, $txt, $maintenance;


Add Below:
    //CUSTOM ACTION!
    // Action
    $i = 1;
    while (isset($modSettings['CA' . $i . '_name']))
    {
        // Is this it?
        if ($context['current_action'] == $modSettings['CA' . $i . '_name'])
        {
            if(!empty($modSettings['CA' . $i . '_css']))
                $context['html_headers'] .= "\n\t\t" . '<link rel="stylesheet" type="text/css" href="'.$scripturl.'?action=css;style='.$i.'" />';
            break;
        }
        $i++;
    }
    // Subaction
    if (isset($_REQUEST['sa']))
    {
        // A subaction was specified, try to find it.
        $n = 1;
        while (isset($modSettings['CA' . $i . '_sa' . $n . '_name']))
        {
            // Is this it?
            if ($_REQUEST['sa'] == $modSettings['CA' . $i . '_sa' . $n . '_name'])
            {
                if(!empty($modSettings['CA' . $i . '_sa' . $n . '_css']))
                    $context['html_headers'] .= "\n\t\t" . '<link rel="stylesheet" type="text/css" href="'.$scripturl.'?action=css;style='.$i.';substyle='.$n.'" />';
                break;
            }
            $n++;
        }
    }
    unset($i);
    unset($n);


If you use the html_headers variable to store those lines, you may find that stylesheets you write in the custom action config can overwrite values in your normal style.css file. If you find this is the case, create a new variable in css such as $context['html_headers']['css'] or whatever you want to call it, and place that in index.template.php.

About the Load.php problem with template_show_custom_action() - apparently that function is repeated twice, for some reason in your load.php file. It looks like your site is working though right now, far as I can tell.
Title: Re: Custom Action Mod
Post by: Hamst3r on August 08, 2008, 01:53:03 PM
Hmm.  I can't get this mod to install.  When I click, "Apply mod" it goes to a blank white screen. :O

I'm using SMF 1.1.5 with these mods installed:

1.     AEF Login Fix 1.0
2.    Remove Post Modified Time 1.2
3.    View_Email_Permission 1.0
4.    AJAX Instant Quick Reply 1.0.1
5.    Prevent Adding Signature Images And Links 1.3

Normally when something doesn't work, it brings up a warning screen about a possible conflict - the fact that it just goes straight to a blank screen is concerning. :P

-
Title: Re: Custom Action Mod
Post by: steph1987 on August 24, 2008, 07:11:23 PM
I Love this mode.....BUT ITS DRIVING ME CRAZY

ive made so many custom pages. and when i upload them it seems to go fine, then just goes to a blank white page (which is done loading). After that i get to admin and try click custom actions and all i get is a white page. ITS KILLING ME!!! ive spent months making my site, had this happen, redid it all and its happened again and i cant get back into custom actions to add new pages or edit the old ones

If anyone has the answer to fix this PLEASE, PLEASE, PLEEAAASSEEEE HELP ME!!!!

i dont wanna spend 3 weeks full time trying to make this again


Thanks guys,

Steph
Title: Re: Custom Action Mod
Post by: steph1987 on August 24, 2008, 11:53:25 PM
also how do i back up my custom mod pages, ive uploaded over 1000 and lose them, then i got to go back and make new page, make the links , link them all again.

Is there a file with them all stored, or some sort of table i have to download (i have no idea how to do this by the way)
Title: Re: Custom Action Mod
Post by: Neorics on September 03, 2008, 12:19:48 AM
Quote from: Atheo on May 16, 2008, 01:45:37 PM
<newb>

OK.  I'm not sure if this is a question for this topic or not but I have to ask.  I am able to use the mod fine.  What I want to do, though, is to change the 'home' button so that it links to my custom page.  I am using smf 2.

Please help.
Thanks!

</newb>

Just a follow up in this question, and I ain't using SMF 2.0

Anybody have a clue?

I tried putting CustomAction.php as the required file when the command is empty in index.php but I cannot get it to choose a certain command so it loads up blank

Also I'm thinking of using the site integration mod but apparently the pages made here are stored in the database instead of a separate php file...

so any help, idea or clue would be fine...
Title: Re: Custom Action Mod
Post by: Neorics on September 03, 2008, 08:59:21 AM
ok, i actually found out how to do what i asked and what Atheo asked


First open: $boarddir/index.php

Find:

      if (empty($board) && empty($topic))
      {
         require_once($sourcedir . '/BoardIndex.php');
         return 'BoardIndex';
      }


Replace by:

      if (empty($board) && empty($topic))
      {
         require_once($sourcedir . '/CustomAction.php');
         return 'CustomAction';
      }



Second open: $sourcedir/CustomAction.php

Find:

// Is this it?
if ($context['current_action'] == $modSettings['CA' . $i . '_name'])
{
// Set $type, $title and $code, which will later be put into the $context variable.
$type = $modSettings['CA' . $i . '_type'];
$title = $modSettings['CA' . $i . '_title'];
$code = $modSettings['CA' . $i . '_code'];
// No need to continue.
break;
}


ADD AFTER:

elseif ($context['current_action'] == '')
{
// Set $type, $title and $code, which will later be put into the $context variable.
$type = $modSettings['CA' . '1' . '_type'];
$title = $modSettings['CA' . '1' . '_title'];
$code = $modSettings['CA' . '1' . '_code'];
// No need to continue.
break;
}


IMPORTANT  NOTE: The number 1 at the above code represents the first custom action you have in the list of custom action pages you made. Change the number accordingly depending on what number the page you want counting from top to bottom.
Title: Re: Custom Action Mod
Post by: cme1st2302 on September 09, 2008, 09:21:16 AM
IS this going to be updated to work with 1.1.6?
Title: Re: Custom Action Mod
Post by: Rumbaar on September 10, 2008, 08:40:58 PM
Quote from: cme1st2302 on September 09, 2008, 09:21:16 AM
IS this going to be updated to work with 1.1.6?
Works perfectly fine with my 1.1.6 forum.
Title: Re: Custom Action Mod
Post by: cme1st2302 on September 11, 2008, 12:09:14 AM
I am confused.  The test fails in the package manager on modSettings.php.  I checked for all the code that it has to replace and it is all there.  Why is it failing the test???
Title: Re: Custom Action Mod
Post by: Rumbaar on September 11, 2008, 01:30:27 AM
It has to be exact, and if it's failing in that single file, you can add the code manually.  Having a single test failed issue doesn't mean it wont work, just means a single (or more) piece of code it needs to find to perform an automated installation isn't there.
Title: Re: Custom Action Mod
Post by: cme1st2302 on September 11, 2008, 09:07:39 AM
I went to the package parser and copied the code exactly from there and did a search for it in the file.  Every one of them was found.  I will most likely just install it anyway and see if it works.
Title: Re: Custom Action Mod
Post by: Rumbaar on September 11, 2008, 09:14:42 AM
Yes, just check and make sure the code is all there.  If not just add and you'll be fine.
Title: Re: Custom Action Mod
Post by: cme1st2302 on September 11, 2008, 10:37:34 AM
:D Thanks for your help Rumbaar!!! :D


One more question.  Where are the files that you create saved at?
Title: Re: Custom Action Mod
Post by: Rumbaar on September 11, 2008, 05:53:38 PM
You're welcome,

Also please edit your post instead of double posting, and also search this thread it has been covered a number of times where the data is stored for each version of SMF.
Quote from: winrules on April 23, 2008, 03:24:19 PM
If you are using SMF 1.1 they are stored in the settings table in the database. If you are using SMF 2.0 they are stored in the custom_actions table.
Title: Re: Custom Action Mod
Post by: Don Pepito on September 25, 2008, 08:27:44 AM
I want to implent this mod to my site, working as it is written in custom installation for 1.1.6 tutorial, but i cannot find Sources/ManageSettings.php  :D
Any help...??
Title: Re: Custom Action Mod
Post by: mrbolsonator on September 29, 2008, 11:37:53 PM
I want to add a wiki to my site. It would involve a page with a search box that links to term pages....like wikipedia but specifically for alternative fuels.

www.fuelcrazyamerica.com

is this possible?
Title: Re: Custom Action Mod
Post by: Rumbaar on September 30, 2008, 12:10:50 AM
Quote from: Don Pepito on September 25, 2008, 08:27:44 AM
I want to implent this mod to my site, working as it is written in custom installation for 1.1.6 tutorial, but i cannot find Sources/ManageSettings.php  :D
Any help...??
You are using the 2.x version, please use the 1.1.x version for your 1.1.x version of the forum.

The custom action can be any custom code you want, either HTML, BBC or PHP.  So if you've got a page written you can put it in there as a custom action.
Title: Re: Custom Action Mod
Post by: Sakae on October 02, 2008, 08:55:25 AM
Hey all, good morning (at least here and at this time LOL)

I would like to change the THEME for one custom action (action=podcast, theme Musiconia... see where it's going?).

How?
Title: Re: Custom Action Mod
Post by: ameo on October 02, 2008, 09:08:31 AM
In your Admin CP if you click under Configuration - Features and options you shall find Custom actions in second row. Right next to basic features.
Title: Re: Custom Action Mod
Post by: Rumbaar on October 02, 2008, 09:09:13 AM
Not possible with the current coding of the mod.  As the theme is loaded before the custom action is called and by then I'm sure it's too late.
Title: Re: Custom Action Mod
Post by: KillerZ on October 15, 2008, 08:21:23 PM
Is there any way to allow blocks to show on the custom made pages using this. I have changed some things to get the custom action to show up in my choose where to be visible section for editing blocks but can only get top blocks to show up on the the custom made page. I am trying to create custom pages and assign blocks to only the custom page. I am using smf 1.1.6 and tp 1.0.5 thanks for any help.
Title: Re: Custom Action Mod
Post by: Rumbaar on October 15, 2008, 08:43:32 PM
As for custom blocks, you might want to search over at TP for tips/tricks relating to the mod and a block.  I know on many occasions I've found a block code to meet my needs when dealing with addon mods.
Title: Re: Custom Action Mod
Post by: KillerZ on October 15, 2008, 11:26:23 PM
Its not a custom block that Im trying to add. Its a custom page(which the mod allows you to do) except I want blocks such as recent topics or stats box or a script box to show only on this custom page. I can get it to work for the top blocks fine. I edited the TPortalAdmin.template.php(which i know is not smf) in the place where it show the extended visible options and got the custom page action to show up on the settings where I can choose what page I want the block to be seen on or all of them. But I can't get it to let me show blocks on the right or left of these custom actions(pages) If I set them to the top or upper blocks they show but won't show on the sides. Why can side panels not show on the custom action, or as I would call them pages?
Title: Re: Custom Action Mod
Post by: Rumbaar on October 15, 2008, 11:37:27 PM
Well the functionality of blocks isn't part of the Custom Action Mod, so I think you need to direct those kind of questions to the TP support forum.  You'll most likely have to create a block for each action and mark it to show on that key action, in the block options.
Title: Re: Custom Action Mod
Post by: KillerZ on October 15, 2008, 11:49:55 PM
Thats what I have done, but the blocks assigned to show in that action if set to the right or left panels do not show. They will show if set to the top panel only? I know that it is a TP question mostly but I was just wondering why this mod will make pages that have visible top panels but not sides, and if there is some way to change that so it shows the side panels? I hoped to be able to use the mod as it creates the page like I want but just creates a page that doesn't have side panels, why is that? What is the blank page it makes a replica of, the forum page with the forum removed? I only ask this because I can't make blocks visible on my forum page either if set to the side panels, only the top panel, I just wondered if there was some way to change the mod to make a page the same as the frontpage on my TP site with all the blocks visible if something is set in them?
Title: Re: Custom Action Mod
Post by: Rumbaar on October 16, 2008, 01:45:48 AM
The display and functionality of TP and it's block with the interaction of any pages or custom action pages is purely a TP related issue.  Please search TP forums, as I found all the answer you seek regard blocks and custom actions when I had the similar issues on my forums.
Title: Re: Custom Action Mod
Post by: KillerZ on October 16, 2008, 03:59:40 AM
Thanks for the help. I finally got it late last night after beating my head off the desk for a week. :D I could try to explain it but don't know if I have the vocabulary for such an explaination. Thanks again for the info and help.
Title: Re: Custom Action Mod
Post by: fermachado on November 04, 2008, 06:07:27 AM
Hi,

It's possible use this mod to put the photopost whit the header and footer of smf.

I have a integration whit smf and photopost. users and styles works good,but I want the photospost to open inside of smf.

Like this http://www.enfoca2.com/galeria/ (http://www.enfoca2.com/galeria/)

Sorry my english
Title: Re: Custom Action Mod
Post by: ryozo on November 05, 2008, 05:37:05 PM
is this mod be able to put custom action into the homepage/frontpage itself?
home is something like www.abc.com/qwerty/index.php

thanks!
Title: Re: Custom Action Mod
Post by: Rumbaar on November 05, 2008, 05:44:43 PM
@fermachado Haven't used that, but if you're able to include the custom action as written PHP code I'm sure you could include it.  But I doubt it would be a straight forward as that and would require a number of path and source rewrites on that applications behalf.

@ryozo  The custom actions will only be access through the forum and index.php file.  So if I read you right, then no you wont be able to use it on your homepage/frontpage.  Unless you're using SMF as this via a portal mod.
Title: Re: Custom Action Mod
Post by: ryozo on November 06, 2008, 11:26:53 AM
ok. thanks!
Title: Re: Custom Action Mod
Post by: wakewatcher on December 09, 2008, 09:23:12 PM
Has anyone tried this with smf 2b4?
Title: Re: Custom Action Mod
Post by: tyhgdgh on December 16, 2008, 05:24:56 PM
I tried this, it wont work correctly in 1.1.7, heres my modsettings.php
Title: Re: Custom Action Mod
Post by: Rumbaar on December 16, 2008, 06:15:01 PM
I have 1.1.7 and this mod works 100% without error or issue.
Title: Re: Custom Action Mod
Post by: tyhgdgh on December 16, 2008, 06:33:23 PM
for me, it wont show the actions tab in features and settings, if thats where it goes
Title: Re: Custom Action Mod
Post by: Rumbaar on December 16, 2008, 07:07:59 PM
Well when you install the mod you got Test Failed errors and you proceed anyway?  Put the mod through the parser and make the manual edits to the that file, and other file that Test Failed, and you should be set.
Title: Re: Custom Action Mod
Post by: tyhgdgh on December 16, 2008, 07:11:05 PM
i did a manual edit, still nothing, the item that failed was the modsettings.php
Title: Re: Custom Action Mod
Post by: Rumbaar on December 16, 2008, 07:14:59 PM
Well you didn't edit it correctly, go back and check that all the code that should be in there is in fact in there.
Title: Screenshot please
Post by: REHK on December 21, 2008, 04:03:32 AM
Hi ive just installed custom action3 on smf 2.0, ive use this mod on 1.17 no problem but i can get the new version to do ******! When i click the new mwnu tab it creates i just get the board. Could someone please post a screenshot of their custom action admin screen with all the code in so I can see what I should be putting where, many thanks, I'm sure this will help many people.

e.g. A screen shot like this but filled in with an actual working action so I can use to test and then modify for my own custom page, thanks

Title: Re: Custom Action Mod
Post by: JaGuR on December 26, 2008, 06:56:21 AM
Great mod ..... Thanks very much,

makes modifying the smf platform so much easier

:D
Title: Re: Custom Action Mod
Post by: brelwit on January 01, 2009, 06:02:24 AM
In the CUSTOMS ACTION mod located in the "Features and Options" Admin page, how do I increase the maximum characters that the Code Textarea Field can accomodate?  I've already increased the maximum capacity of the Value field in the SMF_SETTINGS Table by changing it to MEDIUMTEXT instead of just TEXT but my text input is still being chopped.
Title: Re: Custom Action Mod
Post by: Polymath on January 11, 2009, 11:05:27 PM
Works with 1.1.7

Thanks
Title: Re: Custom Action Mod
Post by: Vandaahl on January 18, 2009, 08:12:59 AM
Quote from: wakewatcher on December 09, 2008, 09:23:12 PM
Has anyone tried this with smf 2b4?

Yes sir, and it works beautifully on my 2.0 beta 4 installation! Remember to manually edit your language files though if you don't use English as your board language.
Title: Re: Custom Action Mod
Post by: Hj Ahmad Rasyid Hj Ismail on January 21, 2009, 02:34:53 PM
I am using membergroup on registration but I only want the invited people to register to certain one membergroup at a time.

For instance if I want to create custom action registermu so that registration through that custom action will only allow member to join Manchester United membergroup. Then, I want to create custom action registerlpl so that registration through that custom action will only allow member to join Liverpool membergroup. And other group etc...

The purpose is that when member is invited with the respective custom action registration link, they can only see and choose to join the given group only rather then seeing the whole group available.

Btw, since the currently custom action page is not viewable by guests, I may need to be change as well so guest can see and register through this page.

Can anybody help me on this? I am using smf 1.1.7. I attached here my register.php file.
Title: Re: Custom Action Mod
Post by: Rumbaar on January 21, 2009, 04:43:52 PM
You're after a custom code to allow for URL to only allow for a single membergroup option.  Which isn't really the realm of support for the mod, as the mod is working for you.

You'll need to try a Mod Request, or the SMF Coding area for that kind of assistance.
Title: Re: Custom Action Mod
Post by: Hj Ahmad Rasyid Hj Ismail on January 21, 2009, 05:02:07 PM
Thank you.
Title: Re: Custom Action Mod
Post by: buspass on February 03, 2009, 11:39:37 PM
Trying to wrap my head around the difference between actions and subactions. I THINK what I want is subactions..

I've got 3 sets of "things to do" depending on the users permissions and the status of some fields in a db table. It's a radio station/shoutcast site, if that helps put it in context

1. if the automatic playlist is active and a user has the right permissions, they have a link in the header that triggers stopping the auto playlist as well as updating some fields in the DB
2. if it's the same user from #1, they now have a link in the header that triggers the auto playlist to re-start(after they're done broadcasting)
3. at all times, admins(and whoever has the right permissions) has a link to "reset" the shoutcast stream

All 3 of these cases are some combination of function()s that I already have working.. Since they're so closely related, I've got them as subactions
http://www.ghettoradio.us/forums/index.php?action=Stream;sa=Start
http://www.ghettoradio.us/forums/index.php?action=Stream;sa=Stop
http://www.ghettoradio.us/forums/index.php?action=Stream;sa=Reset

This means however that I have nothing in the main Stream custom action
I suppose the alternative would be to create each of those as a custom action, without any subactions

I've been reading thru the docs but can't really find a good description of actions vs subactions




2nd part... Since those 3 actions above are all doing 'internal' stuff, what's the best way to do its job and then redirect the user to a specific page?
Title: Re: Custom Action Mod
Post by: Enders on February 04, 2009, 02:50:50 PM
Is there a way to make only "registered" users view it? And how would I add "Members viewing this page" to it?
Title: Re: Custom Action Mod
Post by: Rumbaar on February 04, 2009, 04:39:44 PM
In 1.1.x I don't think it's possible, in 2.x I think there are more permissions options.
Title: Re: Custom Action Mod
Post by: Vandaahl on February 07, 2009, 08:43:14 AM
Will this mod work for version 2 RC1? The installer is giving me a 'test failed' error on Admin.php.
Title: Re: Custom Action Mod
Post by: Rumbaar on February 07, 2009, 05:07:29 PM
Test Failed doesn't indicate it wont work with RC1, but due to the change from BETA to RC I can't say.  Hopefully the developer will answer that one or update the compatibility.
Title: Re: Custom Action Mod
Post by: herka on February 09, 2009, 11:32:51 AM
really looking forward to update! its an great mod!

gj m8!
Title: Re: Custom Action Mod
Post by: Garry1953 on February 10, 2009, 05:29:14 PM
I agree with herka, and also look forward to the RC1 update
Title: Re: Custom Action Mod
Post by: darkelhaym on February 11, 2009, 09:09:02 AM
I tried to do a PHP custom page but when I navigate to the custom action it gives out a blank page. This is the code. I'm running SMF 2.0 Beta 4. I'm a total PHP newbie so maybe I did a mistake in the code.

<?php
require_once("SSI.php");

function 
template_main()

{
global 
$context$db_prefix$options$settings$scripturl$txt$user_info;

echo 
'
<a href="' 
$scripturl'?action=trader&id=' $user_info['id'], '">Vai al tuo profilo di feedback</a>
| <a href="http://www.mysite.com/mlist/?sa=search">Cerca il profilo di un altro utente</a></ br>

<a href="http://www.mysite.com/index.php?action=custom;sa=subcustom">Vai al motore di ricerca carte</a></ br>'
;

if (
in_array(11$user_info['groups']))
echo 
'Grazie per esserti iscritto al Supporter! Ora puoi accedere al motore di ricerca carte.';

else
echo 
'Ricorda che per accedere al motore di ricerca carte devi essere un Supporter! Clicca <a href="http://www.mysite.com/profile?sa=subscriptions"> QUI </a>per iscriverti!';

}
?>
Title: Re: Custom Action Mod
Post by: cme1st2302 on February 12, 2009, 02:35:22 PM
I have this mod installed on my 1.1.8 forum and would like to know how to stop the subactions from opening in a new window?

Thanks,
Chris
Title: Re: Custom Action Mod
Post by: Rumbaar on February 12, 2009, 04:32:43 PM
There must be coding in your sub-action or externally, as any action shouldn't be opening a new window via it's own code.
Title: Re: Custom Action Mod
Post by: buspass on February 12, 2009, 10:38:07 PM
Quote from: darkelhaym on February 11, 2009, 09:09:02 AM
I tried to do a PHP custom page but when I navigate to the custom action it gives out a blank page. This is the code. I'm running SMF 2.0 Beta 4. I'm a total PHP newbie so maybe I did a mistake in the code.

Take out the <?php and ?> tags

require_once should be your first line and } should be how it ends
Title: Re: Custom Action Mod
Post by: darkelhaym on February 13, 2009, 04:31:37 AM
Quote from: buspass on February 12, 2009, 10:38:07 PM
Quote from: darkelhaym on February 11, 2009, 09:09:02 AM
I tried to do a PHP custom page but when I navigate to the custom action it gives out a blank page. This is the code. I'm running SMF 2.0 Beta 4. I'm a total PHP newbie so maybe I did a mistake in the code.

Take out the <?php and ?> tags

require_once should be your first line and } should be how it ends

Did not work alone, but started working when I took out this line: function template_main() Thanks!
Title: Re: Custom Action Mod
Post by: Nibogo on February 13, 2009, 06:51:41 PM
The MOD works pretty cool on SMF 2.0 RC1 , You just have to go:

yourforum.com/index.php?action=admin;area=featuresettings;sa=action
Title: Re: Custom Action Mod
Post by: Garry1953 on February 13, 2009, 07:44:29 PM
NIBOGO
Handy Hint, Thanks  :D
Title: Re: Custom Action Mod
Post by: kingkingston on February 22, 2009, 02:39:57 AM
Awesome mod
Title: Re: Custom Action Mod
Post by: alexx_ori on February 23, 2009, 10:07:13 AM
can anyone help me with the installation of this mod in smf 2.0 RC1?

code parser saying me:

Quoteinstall.php
This file should not be able to execute standalone. You may have to run the following queries manually.

how can i do this?

thanks  :D
Title: Re: Custom Action Mod
Post by: Rumbaar on February 23, 2009, 04:39:18 PM
Do a search, as running queries isn't mod specific, but you'll need to run the queries at your phpMyAdmin level.  Be sure to put n correct smf prefix for your db.  default is smf_
Title: Re: Custom Action Mod
Post by: Bl4ck.bt on February 24, 2009, 09:13:16 AM
Quote from: Rumbaar on February 23, 2009, 04:39:18 PM
Do a search, as running queries isn't mod specific, but you'll need to run the queries at your phpMyAdmin level.  Be sure to put n correct smf prefix for your db.  default is smf_

sorry, what i have to do exactly? can you explain me how and where i have to put the queries? thanks in adv
Title: Re: Custom Action Mod
Post by: madman71 on February 25, 2009, 11:19:14 AM
hey guys,

I just installed the mod. All seems fine, but when i click on Features and Options in the CP, i get a blank page.  Any ideas?

running 1.1.8 - heavily modded - Custom theme installed

edit: ive added the index file and Modsetting file as attachemnt here.

Title: Re: Custom Action Mod
Post by: Rumbaar on February 25, 2009, 04:12:24 PM
index.php should have anything to do with it.  Be sure to set your language to english.  Also did it install without any test failed messages?
Title: Re: Custom Action Mod
Post by: madman71 on February 25, 2009, 04:24:57 PM
yes, it installed with no error.

according to the help install file is says to edit the index.php file
(http://imagesocket.com/view/untitled364.JPG)

I'll check the language
Title: Re: Custom Action Mod
Post by: Rumbaar on February 25, 2009, 04:56:58 PM
Yes I meant the index.php file wouldn't be causing the issue.

Please use the parser for the mod and check the code in your ModSetting.php file.  There appears to be errors with the insertion of the mods code into that file.
Title: Re: Custom Action Mod
Post by: madman71 on February 25, 2009, 05:02:05 PM
thanks, Rum.

i'll do that
Title: Re: Custom Action Mod
Post by: madman71 on February 25, 2009, 05:36:20 PM
error found.  Thanks Rum.

it's working just fine now :)
Title: Re: Custom Action Mod
Post by: AlenNS on March 02, 2009, 05:36:26 PM
Winrules Does your mod needs some update for RC1 or I can use this 3.0 version ( Beta 3 compatible )? :)
Title: Re: Custom Action Mod
Post by: Nibogo on March 02, 2009, 06:12:49 PM
Quote from: AlenNS on March 02, 2009, 05:36:26 PM
Winrules Does your mod needs some update for RC1 or I can use this 3.0 version ( Beta 3 compatible )? :)

http://www.simplemachines.org/community/index.php?topic=86793.msg1930782#msg1930782
Title: Re: Custom Action Mod
Post by: AlenNS on March 02, 2009, 06:46:39 PM
I had installed this mod on Beta 4 and now I'm using RC1.
I am getting this error on installation:

QuoteDatabase Error                                     Table 'baklja_smf1.custom_actions' doesn't exist
File: /home/baklja/public_html/forum/Packages/temp/install.php
Line: 98

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0 RC1, while your database is at version 2.0 Beta 4. The above error might possibly go away if you execute the latest version of upgrade.php.
Title: Re: Custom Action Mod
Post by: Nibogo on March 02, 2009, 07:04:17 PM
Add manually the tables to your db
Title: Re: Custom Action Mod
Post by: AlenNS on March 02, 2009, 07:47:15 PM
I'm not sure if I would know to do that. :S
Are the instructions in install.php?
Title: Re: Custom Action Mod
Post by: Nibogo on March 02, 2009, 07:59:18 PM
Yep with your own prefix of course
Title: Re: Custom Action Mod
Post by: AlenNS on March 02, 2009, 08:27:25 PM
Ok. I'll try. Thanx
Title: Re: Custom Action Mod
Post by: AlenNS on March 03, 2009, 09:20:06 AM
Quote from: NIBOGO on March 02, 2009, 07:04:17 PM
Add manually the tables to your db
I solved this problem.
I left this table in my database after upgrade to RC1 and when I deleted it installation was successful.

I had one error in installation.



Sources file: Admin.php

It asks for:

Quote'pruning' => array($txt['pruning_title']),

And I have this:

Quote'pruning' => array($txt['pruning_title'], 'admin_forum'),

So I insert this line after:

Quote'action' => array($txt['custom_action_shorttitle'], 'admin_forum'),
Title: Re: Custom Action Mod
Post by: madman71 on March 10, 2009, 05:01:37 PM
Im trying to produce a page of recent topics and i've added the following code with PHP set.
It's not working for me.  Am i missing something?  It does produce my themed page but not a  recent topic listing



require("/httpdocs/forum/SSI.php");
ssi_recentTopics();
Title: Re: Custom Action Mod
Post by: madman71 on March 10, 2009, 11:24:04 PM
ok, after a bit more digging, i decided to make a test.php page and upload it to my forum directory.

the contents of this page is:


<?php
require(dirname(__FILE__) . '/SSI.php');
ssi_welcome();
?>


Dont ask me how i came up with that path to my SSI.  I found it  in my ssi example php.  From what it seems that does not look like the standard path, but anyway, i load up the  test.php file in my browser and it works!!!

Now, when i paste it in a custom action  it doesnt work :(
and yes, i did leave off the <?php   and ?>


any ideas?
Title: Re: Custom Action Mod
Post by: madman71 on March 11, 2009, 05:50:18 PM
Got it working with:

require_once("SSI.php");
ssi_recentTopics();
Title: Re: Custom Action Mod
Post by: fotografo74 on March 12, 2009, 05:26:18 AM
Quote from: NIBOGO on February 13, 2009, 06:51:41 PM
The MOD works pretty cool on SMF 2.0 RC1 , You just have to go:

yourforum.com/index.php?action=admin;area=featuresettings;sa=action
NIBOGO, but is not a button in Admin area?
I installed manually this nice Mod and works ok, but i have not the button in admin area..it's normal?
I have SMF2 RC1
Thanks!
Antonio
Title: Re: Custom Action Mod
Post by: Vandaahl on March 12, 2009, 07:23:39 AM
Quote from: fotografo74 on March 12, 2009, 05:26:18 AM
Quote from: NIBOGO on February 13, 2009, 06:51:41 PM
The MOD works pretty cool on SMF 2.0 RC1 , You just have to go:

yourforum.com/index.php?action=admin;area=featuresettings;sa=action
NIBOGO, but is not a button in Admin area?
I installed manually this nice Mod and works ok, but i have not the button in admin area..it's normal?
I have SMF2 RC1
Thanks!
Antonio

Yes it's normal on RC1, I have no button either. We'll have to wait for an updated version in the meantime!
Title: Re: Custom Action Mod
Post by: fotografo74 on March 12, 2009, 09:25:01 AM
Quote from: Vandaahl on March 12, 2009, 07:23:39 AM
Quote from: fotografo74 on March 12, 2009, 05:26:18 AM
Quote from: NIBOGO on February 13, 2009, 06:51:41 PM
The MOD works pretty cool on SMF 2.0 RC1 , You just have to go:

yourforum.com/index.php?action=admin;area=featuresettings;sa=action
NIBOGO, but is not a button in Admin area?
I installed manually this nice Mod and works ok, but i have not the button in admin area..it's normal?
I have SMF2 RC1
Thanks!
Antonio

Yes it's normal on RC1, I have no button either. We'll have to wait for an updated version in the meantime!
Oh, thanks ! :-)
Antonio
Title: Re: Custom Action Mod
Post by: c23_Mike on March 19, 2009, 09:41:57 AM
Hi there !

Same here. But I had also the problem, when I go to the link given here directly to the costum action mod admin page, I do not habe the menus for edit and create costum action pages ....

So it will not work for me.
Is this because I have a german board?
What to do??

So, after hack the "load standard language" mod also this mod works fine with 2.0RC1  :D
Title: Re: Custom Action Mod
Post by: Rumbaar on March 19, 2009, 04:55:30 PM
Yes you need to ensure that all mod specific $txt[] are converted and installed for your current language.
Title: Re: Custom Action Mod
Post by: KraTe on April 15, 2009, 08:15:30 AM
Can I install this to 1.1.8 with package manager or do I have to install it manually??
Title: Re: Custom Action Mod
Post by: KraTe on April 15, 2009, 04:37:42 PM
Quote from: KraTe on April 15, 2009, 08:15:30 AM
Can I install this to 1.1.8 with package manager or do I have to install it manually??

ok looks like it works.. forget the above
Title: Re: Custom Action Mod
Post by: javierjp on April 19, 2009, 10:21:31 AM
Hi,
Exist any update to 1.1.8?   
I just discovered 1.1.8 messed up all my sub-actions.

thanks in advance.
best regards
javier
Title: Re: Custom Action Mod
Post by: EZ1 on April 19, 2009, 10:27:59 AM
ok -- this has a upgrade next to it when i click upgrade i get


QuoteSorry, but there is no upgrade package from your version. Please uninstall the previous version, and install this version. You won't lose any data.

QuoteInstall Actions
Installations actions for "Custom Action Mod":
The package you are trying to download or install is either corrupt or not compatible with this version of SMF. 

In the Package Manager it says

QuoteCustom Action Mod 3.0   [ Upgrade ] [ List Files ] [ Delete ]

any thoughts ??
Title: Re: Custom Action Mod
Post by: robinrobin on April 23, 2009, 11:03:44 AM
And how are you supposed to create actions if there is nothing in the admin panel? The "index.php?action=admin;area=featuresettings;sa=action" address simply takes me to the index page.

Can you create login/logout landing pages with this mod that you can add custom code to?
Title: Re: Custom Action Mod
Post by: Rumbaar on April 23, 2009, 05:48:52 PM
Quote from: robinrobin on April 23, 2009, 11:03:44 AM
And how are you supposed to create actions if there is nothing in the admin panel?
If you have no entry in your Admin CP then you've not 100% successfully installed the mod.  Try taking a look at your error log or noted Test Failed entries when you installed the mod.
Title: Re: Custom Action Mod
Post by: robinrobin on April 23, 2009, 06:04:59 PM
Hmm, well, i only had one problem, with the Admin.php file, but i added that manually. Like the guy here (http://www.simplemachines.org/community/index.php?topic=86793.msg1959718#msg1959718). Sorry for having so many troubles, Rumbaar, lol. I don't know why i always have them.
Title: Re: Custom Action Mod
Post by: Rumbaar on April 23, 2009, 06:10:47 PM
No entries in your error log about undefined indexes?  What language are you using?
Title: Re: Custom Action Mod
Post by: robinrobin on April 23, 2009, 06:27:57 PM
My error log is actually completely empty... that's kinda odd, isn't it?? Maybe it pruned it right after i isntalled the mod or something. Oh, it's English.
Title: Re: Custom Action Mod
Post by: robinrobin on April 23, 2009, 06:29:42 PM
Or no, wait, what error log? I don't even have such a thing in my logs page in my ACP. The Custom Action mod's log thing is here though, but it shows no errors in it. I just see these:

Admin Log       Moderation Log       Ban Log       Spider Log       Task Log       Log Pruning             Custom Actions            
Title: Re: Custom Action Mod
Post by: Rumbaar on April 23, 2009, 06:38:59 PM
No under maintenance in your AdminCP, as what you've posted don't seem to be entries for that location.  You also have to have error logging enabled I'm sure.
Title: Re: Custom Action Mod
Post by: robinrobin on April 23, 2009, 10:14:56 PM
Uh, i'm sorry, but i can't find no error log in there either.

Database

Optimize all tables
Backup Database
Convert the database and data to UTF-8

-

Routine

Check all files against current versions
Find and repair any errors (Didn't find any)
Recount all forum totals and statistics
Empty out unimportant logs
Empty the file cache
-

Members

-

Topics
Title: Re: Custom Action Mod
Post by: Rumbaar on April 23, 2009, 11:53:03 PM
What version of SMF are you using?

1.1
Enable:
AdminCP->Features and Options->General=>Enable error logging
Check Log:
AdminCP=>Forum Error Log

2.0
Enable:
AdminCP->Security and Moderation->General=>Enable error logging
Check Log:
AdminCP=>Logs
Title: Re: Custom Action Mod
Post by: Fredrik_J on April 24, 2009, 08:00:43 AM
Just a note about the Custom Actions Log entry. As far as I can tell this is the result of the suggestion given about the change in Admin.php. It will on purpose put the AdminCP entry for Custom Actions in this place (at least on 2.0RC1). So, this isn´t any special logs for Custom Actions, it´s supposed to be the link to the settings. But that´s as far as I´ve gotten too, since it doesn´t really do anything when pressed (it defaults to displaying the error log, but that has nothing to do with it´s intentional purpose).

I suggest putting the link under "Configuration" / "Modifications" instead. This should be somewhere just after line 200 in Admin.php. Search for // Mod Authors for a "ADD AFTER" on this line. and make the change above this. If anyone running RC1 can tell me exactly what to put there to also make the link work, I would be very grateful.

EDITED:

First - the change to Admin.php mentioned above is in this message: http://www.simplemachines.org/community/index.php?topic=86793.msg1959718#msg1959718

Second - I missed this earlier:

Quote from: NIBOGO on February 13, 2009, 06:51:41 PM
The MOD works pretty cool on SMF 2.0 RC1 , You just have to go:

yourforum.com/index.php?action=admin;area=featuresettings;sa=action

So - another guess since I'm not able to test this at the moment - a solution would possibly be to edit the change to Admin.php to include the link above. I'll experiment with this and get back with the results in a day or two when I'm back home again.
Title: Re: Custom Action Mod
Post by: robinrobin on April 24, 2009, 10:14:56 AM
Hmm, i thought there was something odd about that link, Fredrik. I'll look into that now.
Title: Re: Custom Action Mod
Post by: robinrobin on April 24, 2009, 10:24:55 AM
Oh wow, Rumbaar, thank you! How could i have missed that? lol, that's an important one!

Uh.... wow... ok, lol, i get errors all the time simply visiting around in the ACP. When i activated the error logging just now, i had 7 errors. Clicking on "Undefined" i got two more! Clicking on "Admin Log" and going back to the error log, i got 18 errors in there! What on earth is going on?!

Edit: Ok, so two undefined errors are repeating themselves all the time because i installed the new version of the Gallery2 bridge yesterday but it didn't install completely, so those should go away when i fix that mod. These are the errors that i have that i don't know where they came from:

http://www.website.com/forum/index.php?http://www.website.com/forum/
1024: Canview method for getMembersOnlineTodayStats() function is not allowed
File: /public_html/forum/Sources/Admin.php
Line: 205

When i click on the File address above, a window opens that shows where the error is in the code. And i then see this:

// Default is that only registered users can see the list.
if (!isset($membersOnlineTodayOptions['canview']))
{
$membersOnlineTodayOptions['canview'] = 'registered';
}

// Not allowed canview method? Bang! Error!

elseif (!in_array($membersOnlineTodayOptions['canview'], $allowed_canview_options))
trigger_error('Canview method for getMembersOnlineTodayStats() function is not allowed', E_USER_NOTICE);


That is quite odd i think, because i'm logged in as administrator, so uh, why am i not allowed to view online members today?

--

http://www.website.com/forum/index.php?action=admin;area=securitysettings;sa=general
8: Undefined index: label
File: /public_html/forum/Themes/default/GenericMenu.template.php (generic_menu_sidebar_above sub template - eval?)
Line: 306

That one doesn't have a link to where the error is when i hover the mouse over the File address.
Title: Re: Custom Action Mod
Post by: Rumbaar on April 25, 2009, 10:29:49 PM
@robinrobin You should create a support thread in the 2.0 (I'll assume 2.0 as you've not stated still) section, as I'm sure all the errors you are getting aren't mod specific and this is not the place to discuss it.
Title: Re: Custom Action Mod
Post by: Fredrik_J on April 26, 2009, 06:28:17 PM
Hi again,

Here´s one way to make a working link in Admin CP for SMF 2.0 RC1. This IS NOT 100% clean, and my only reason for posting this is that someone else might see it and know how to improve it. I´m really no expert at SMF, so please remember this before you blame me for anything bad happening. I suggest you use this for reference only, but that´s up to you. I´ll just say this once again to make sure you get it - I´m not taking any responsibility if you use this method! But it does work, and as far as I can tell it does not produce any errors. Anyway, this is what I did:

First - Install the mod and ignore the error in Admin.php.

Find this passage in Admin.php (somewhere around/just after line 200). Please note the two ), at the end:

// Mod Authors for a "ADD AFTER" on this line. Ensure you end your change with a comma. For example:
// 'shout' => array($txt['shout']),
// Note the comma!! The setting with automatically appear with the first mod to be added.
),
),


AFTER this I added the following:

//This is a working link for Custom Actions settings page
'customaction' => array(
'label' => $txt['custom_action_shorttitle'],
'file' => 'CustomAction.php',
'custom_url' => $scripturl . '?action=admin;area=featuresettings;sa=action',
),


Please note the following:

1) 'customaction' is something I made up. I didn´t know what else to put there, and for this to work I don´t think it matters, as long as nothing else uses the same name.

2) The link will show up in Admin CP under "Configuration"

3) It will have the same subsections as "Features and Options" - these links will work, but obviously has nothing to do with the Custom Action mod. I just don´t know how to get rid of them. Custom Action only has one main page for settings.

4) I think that a better place to make the change is a few rows up (not at least because the comment more or less tells you to), placing the link in Configuration/Modifications, but I can´t get this to work at the moment.

5) A much better way to make this change is to unzip the mod pack, change the instruction for Admin.php in modifications.xml, repack it, and install it the normal way, but at the moment I can´t get this to work.

6) A last advice for those of you using some other language than english (which results in that you can´t see any buttons etc. on the settings page). Unpack the mod and look in modifications.xml. There is an entry for "ManageSettings.english.php". You need to add the same text strings to "ManageSettings.your_language.php". If you really need this, but can´t figure it out - let me know and I can provide more detailed instructions.

Best regards,

Fredrik
Title: Re: Custom Action Mod
Post by: MissyNL on April 28, 2009, 11:43:28 AM
Hello...

I have SMF 1.1.8  and i want to include a php page into my forum. I have used custom actions mod (an php page), but then it gives me this error

Parse error: syntax error, unexpected '<' in /home/bimeiden/domains/bimeiden.nl/public_html/Themes/default/CustomAction.template.php(9) : eval()'d code on line 1

I have a custom theme..

I have the page attached that i want to include... its a chat...

what can i do?
Title: Re: Custom Action Mod
Post by: buspass on April 29, 2009, 09:17:23 AM
Try taking out the <?php and ?> tags at the very beginning and end of your chat page
Title: Re: Custom Action Mod
Post by: MissyNL on May 01, 2009, 05:59:10 AM
have done that... now it says this:

Parse error: syntax error, unexpected '<' in /home/bimeiden/domains/bimeiden.nl/public_html/Themes/default/CustomAction.template.php(9) : eval()'d code on line 26

It is the part where <html> begins... :(
Title: Re: Custom Action Mod
Post by: MissyNL on May 04, 2009, 07:06:32 AM
hello.. sorry for bumping this up.. but i really want to integrate the chat.. so if anyone can help me.. then please :)
Title: Re: Custom Action Mod
Post by: Darkorical on May 05, 2009, 11:20:46 AM
try pasting this code exactly in your custom action and make your page title "123 Flash Chat"


if (!defined("SMF")) define("SMF", "1");
include('Settings.php');
include('Sources/Load.php');
include('Sources/Subs-Auth.php');
include("mysql4.php");
$_COOKIE[$cookiename] = stripslashes($_COOKIE[$cookiename]);
echo $_cookiename;
list ($ID_MEMBER, $password) = @unserialize($_COOKIE[$cookiename]);
$username_field = "memberName";
$password_field = "passwd";
$usertable  = $db_prefix."members ";
$db = new sql_db($db_server, $db_user, $db_passwd, $db_name, false);
$sql = "SELECT " . $username_field.",".$password_field.
" FROM " . $usertable . "
WHERE ID_MEMBER = ".$ID_MEMBER;

$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$username = $row[$username_field];
$password = $row[$password_field];
$user = '';
if($username !=''){
$user = '&init_user='.$username.'&init_password='. $password;
}
echo'
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/ swflash.cab#version=6,0,19,0" WIDTH="634" HEIGHT="476">
<PARAM NAME=movie VALUE="client/123flashchat.swf?init_room=1'.$user.'">
<PARAM NAME=quality VALUE="high"> <PARAM NAME="menu" value="false">
<EMBED src="client/123flashchat.swf?init_room=1'. $user.'" quality=high menu=false WIDTH="634" HEIGHT="476" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>';


remember DO NOT ADD <? or ?>!
Title: Re: Custom Action Mod
Post by: MissyNL on May 05, 2009, 03:10:26 PM
This time it gave a total other error then what i have seen so far....


Fatal error: Cannot redeclare reloadsettings() (previously declared in /xxx/xxx/xxx/xxx/xxx/Sources/Load.php:140) in /xxx/xxx/xxx/xxx/xxx/Sources/Load.php on line 342


weird....

thanks for the reply tho!  :D
Title: Re: Custom Action Mod
Post by: Darkorical on May 05, 2009, 05:28:35 PM
okie dokie I got that same error when I tested it on my site  (but I didnt have the rest of the stuff so I thought it might fix it for someone with all the files so Ill look at it again and see what I can come up with
Title: Re: Custom Action Mod
Post by: Darkorical on May 05, 2009, 05:38:30 PM
I dont have a clue if this will work or not but give it a shot and see what happens Ill look more into it tommarow


if (!defined("SMF")) define("SMF", "1");
global $user_info;
include("mysql4.php");
$user = '';
if($username !=''){

$user = '&init_user='.$context['user']['name'].'&init_password=pass';

}


echo'
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/ swflash.cab#version=6,0,19,0" WIDTH="634" HEIGHT="476">
<PARAM NAME=movie VALUE="client/123flashchat.swf?init_room=1'.$user.'">
<PARAM NAME=quality VALUE="high"> <PARAM NAME="menu" value="false">
<EMBED src="client/123flashchat.swf?init_room=1'.$user.'" quality=high menu=false WIDTH="634" HEIGHT="476" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>';
Title: Re: Custom Action Mod
Post by: MissyNL on May 06, 2009, 07:50:39 AM
It works!!!!  Freaking awsome!!! Thank you so much!

The only thing is that the members are not automatically logged in, so they have to fill in there password. But i can live with that  :D
Title: Re: Custom Action Mod
Post by: MissyNL on May 06, 2009, 08:01:45 AM
I also have found out a nother problem... i have my own theme with a pulldown menu. Now the pull down menu is not visable, since it go's "behind" the page. What can i do?

And i also have the same version chat, but an avatar chat. Now i have only changed the .swf name and it works, however.. i have to erase the


if (!defined("SMF")) define("SMF", "1");
global $user_info;
include("mysql4.php");
$user = '';
if($username !=''){
   
   $user = '&init_user='.$context['user']['name'].'&init_password=pass';
   
}


part.. since this line is showing above the chat.
Title: Re: Custom Action Mod
Post by: eslao on June 11, 2009, 11:58:44 AM
Quote from: NIBOGO on February 13, 2009, 06:51:41 PM
The MOD works pretty cool on SMF 2.0 RC1 , You just have to go:

yourforum.com/index.php?action=admin;area=featuresettings;sa=action

how ?
Title: Re: Custom Action Mod
Post by: itweb on June 22, 2009, 03:43:29 PM
Let's say a custom action is html code but it works with a script that uses some files in folders.

Where should these folders be placed inside the SMF root, so the are called properly without modifying the paths.

Folders call for /something/abc.js
so they call the relative location

What would be a relative location for the custom action? Theme folder? Sources?
Title: Re: Custom Action Mod
Post by: Fooz on July 06, 2009, 03:19:22 AM
I get "Test Failed" - Execute Modification on ./Sources/Admin.php

I have SimplePortal 2.2.2 installed on my SMF 2.0 RC1-1

The modification on the file should be:


Find [Select]
'pruning' => array($txt['pruning_title']),
Replace [Select]
'pruning' => array($txt['pruning_title']),
'action' => array($txt['custom_action_shorttitle']),


But as far as I can see the string we want to replace should be

'pruning' => array($txt['pruning_title'], 'admin_forum'),

Not sure what will happen if i just continue with the install and replace the line in question manually...

Please help me out a bit :)
Title: Re: Custom Action Mod
Post by: Chamaeleon on July 15, 2009, 11:19:16 AM
SMF 2.0 RC1-1 + SMF 2.0 RC1-2

Admin.php

Find

'profile' => array($txt['custom_profile_shorttitle'], 'enabled' => in_array('cp', $context['admin_features'])),

Replace with


'profile' => array($txt['custom_profile_shorttitle'], 'enabled' => in_array('cp', $context['admin_features'])),
'action' => array($txt['custom_action_shorttitle'], 'admin_forum'),
Title: Re: Custom Action Mod
Post by: SlammedDime on July 16, 2009, 07:51:45 PM
Not sure if Winrules is actively keeping this updated or not... but I made some changes to the back end so it was easier to edit code, including adding a javascript syntax highlighter/editor...

Title: Re: Custom Action Mod
Post by: RedCairo on July 17, 2009, 04:24:47 AM
Quote from: MissyNL on May 05, 2009, 03:10:26 PM
This time it gave a total other error then what i have seen so far....


Fatal error: Cannot redeclare reloadsettings() (previously declared in /xxx/xxx/xxx/xxx/xxx/Sources/Load.php:140) in /xxx/xxx/xxx/xxx/xxx/Sources/Load.php on line 342


thanks for the reply tho!  :D


I hate to gripe but apparently this got solved and nobody posted HOW, so of course after all this reading I finally find the same problem I'm having but no solution.  OK moving on . . . . what is the solution to this error?  Thanks.

Palyne
Title: Re: Custom Action Mod
Post by: SlammedDime on July 17, 2009, 06:59:39 AM
Anything that is redeclared means the function has been, as the error says, declared more than once, which is not possible in PHP...

You should almost never use include() or require()... you should use include_once() or require_once() instead.
Title: Re: Custom Action Mod
Post by: dreaded on September 07, 2009, 06:56:29 PM
Hello, I have installed the Custom tab, which i intend using it for Live Radio. I have another site that i have intergrated the radios in with a pop up javascript and i believe this Custom Ad Mod could help me intergrate that javascript into my forum via the Radio Custom Tab made.

But to be honest, i just don't where to paste my javascript code so that when someone clicks on the Radio Custom Tab, the radio stations will pop up.

Could someone pls help me out?

Here's my js code:<script language="JavaScript">!--
function popUp {
window.popUp("Streams/Peacefm.html","Window1","menubar=no,width=470,height=490,toolbar=no,resizable=no,scrollbars=no");
}
/</script>
     
     
      <p><a href="javascript:void();" onclick="win1(); return true;"> <b><img style="width: 98px; height: 30px;" alt="" src="custom.gif"><br>


      </b></a>


Thnx.

PS: Am using the babylon theme 1.1.10
Title: Re: Custom Action Mod
Post by: dreaded on September 13, 2009, 06:25:32 PM
Solved! :D
Title: Re: Custom Action Mod
Post by: AlenNS on September 15, 2009, 04:42:21 AM
Quote from: Chamaeleon on July 15, 2009, 11:19:16 AM
SMF 2.0 RC1-1 + SMF 2.0 RC1-2

Admin.php

Find

'profile' => array($txt['custom_profile_shorttitle'], 'enabled' => in_array('cp', $context['admin_features'])),

Replace with


'profile' => array($txt['custom_profile_shorttitle'], 'enabled' => in_array('cp', $context['admin_features'])),
'action' => array($txt['custom_action_shorttitle'], 'admin_forum'),

Works excellent!
Title: Re: Custom Action Mod
Post by: c23_Mike on October 18, 2009, 04:06:15 PM
Hi there !

It cannot be installed on RC2, are you working on an update?

Not to find in Sources/Admin.php
Quote'pruning' => array($txt['pruning_title']),

and

not to find in Sources/Subs.php

Quote$load_menu_js = false;

Title: Re: Custom Action Mod
Post by: Chamaeleon on November 15, 2009, 07:13:30 AM
Quote from: c23_Mike on October 18, 2009, 04:06:15 PM
Hi there !

It cannot be installed on RC2, are you working on an update?

Not to find in Sources/Admin.php
Quote'pruning' => array($txt['pruning_title']),

and

not to find in Sources/Subs.php

Quote$load_menu_js = false;



SMF 2.0 RC2

Quote from: Chamaeleon on July 15, 2009, 11:19:16 AM

Admin.php

Find

'profile' => array($txt['custom_profile_shorttitle'], 'enabled' => in_array('cp', $context['admin_features'])),

Replace with


'profile' => array($txt['custom_profile_shorttitle'], 'enabled' => in_array('cp', $context['admin_features'])),
'action' => array($txt['custom_action_shorttitle'], 'admin_forum'),


Sources/Subs.php:

Find

// Now we put the buttons in the context so the theme can use them.

Replace with

// Any custom action buttons?
$ca_buttons = unserialize($modSettings['ca_menu_cache']);
foreach ($ca_buttons as $button)
{
$buttons[$button[0]] = array(
'title' => $button[1],
'href' => $scripturl . '?action=' . $button[0],
'show' => $button[2] ? allowedTo($button[2]) : true,
'sub_buttons' => array(
),
'is_last' => true,
);
}

// Now we put the buttons in the context so the theme can use them.
Title: Re: Custom Action Mod
Post by: Mick. on November 15, 2009, 10:06:37 AM
Where do i add the install.php to run it from my browser?

root folder or sources folder?
Title: Re: Custom Action Mod
Post by: Chamaeleon on November 15, 2009, 10:22:59 AM
Quote from: BlueDevil on November 15, 2009, 10:06:37 AM
Where do i add the install.php to run it from my browser?

root folder or sources folder?

root folder

-------------------------------------
SMF 2.0 RC2

bevor open "install.php"

find
$smcFunc['db_create_table']('custom_actions', $columns, $indexes, array(), 'update_remove');

Replace with
$smcFunc['db_create_table']('{db_prefix}custom_actions', $columns, $indexes, array(), 'update_remove');
Title: Re: Custom Action Mod
Post by: Mick. on November 15, 2009, 10:36:33 AM
Quote from: Chamaeleon on November 15, 2009, 10:22:59 AM
Quote from: BlueDevil on November 15, 2009, 10:06:37 AM
Where do i add the install.php to run it from my browser?

root folder or sources folder?

root folder

-------------------------------------
SMF 2.0 RC2

bevor open "install.php"

find
$smcFunc['db_create_table']('custom_actions', $columns, $indexes, array(), 'update_remove');

Replace with
$smcFunc['db_create_table']('{db_prefix}custom_actions', $columns, $indexes, array(), 'update_remove');

I get this error:

Fatal error: Call to undefined function updatesettings() in /home/********/public_html/install.php on line 9
Title: Re: Custom Action Mod
Post by: Mick. on November 15, 2009, 10:38:18 AM
Reason i need to use the install.php simply because im trying to add this mod manually for RC2 but i found this in admin,

Table '********_smf1.smf_custom_actions' doesn't exist
File: /home/********/public_html/Sources/ManageSettings.php
Line: 2361
Title: Re: Custom Action Mod
Post by: Chamaeleon on November 15, 2009, 11:15:30 AM
Install the Mod. with Packet Manager
   
then manually edit Admin.php and Subs.php

go into the database, search for "custom_actions" Table and add the prefix

edit:
Quote from: BlueDevil on November 15, 2009, 10:36:33 AM
Fatal error: Call to undefined function updatesettings() in /home/********/public_html/install.php on line 9

root of your Forum...same Folder of index.php, SSI.php........
Title: Re: Custom Action Mod
Post by: TurtleKicker on November 20, 2009, 02:55:45 PM
If all these edits can make this mod work in RC2, it'd be really nice if someone packaged them all up into a new version of the mod which can be installed cleanly. :)
Title: Re: Custom Action Mod
Post by: Do2 on November 22, 2009, 04:38:57 PM
I think you should ask the author if you're allowed to edit and release the mod. ;)
Title: Re: Custom Action Mod
Post by: jpb on November 26, 2009, 04:22:56 AM
Quote from: sremick on November 20, 2009, 02:55:45 PM
If all these edits can make this mod work in RC2, it'd be really nice if someone packaged them all up into a new version of the mod which can be installed cleanly. :)

I agree!

jpb
Title: Re: Custom Action Mod
Post by: _sebas_ on December 04, 2009, 07:34:56 AM
Quote from: sebtor on October 04, 2009, 09:37:00 PM

in HTML parse

external links made like this code :   

http://www.astronomo.org/foro/"http://www.wikipedia.com/wiki/Procyon_estrella"

Can it be solved?

anyone idea ?

:'(
Title: Re: Custom Action Mod
Post by: jclawson27 on December 18, 2009, 09:25:51 PM
hi everyone, not sure if someone has already posted with this issue my eyes started going numb after scanning 10 pages of posts. lol

So I love this mod and it has been working great w/my html code, but once I add some php to my html and switched the code type to PHP I get the error below. Any help would be great

Parse error: syntax error, unexpected '<' in /home/content/j/c/l/jclawson01/html/forum/Sources/Load.php(1733) : eval()'d code(9) : eval()'d code on line 1

I am using version 1.1.11

And yes I get the same error when just attempting basic php code
Title: Re: Custom Action Mod
Post by: Josh79 on January 26, 2010, 01:57:14 PM
I can get the custom action tab to show up, but when I click it i get this error?  I change the coding in admin.php and subs.php. 

Database Error

Table 'kalyra_smf.smf_custom_actions' doesn't exist
File: /home/kalyra/public_html/forum/Sources/ManageSettings.php
Line: 2221
Title: Re: Custom Action Mod -- error when I click custom actions
Post by: Josh79 on February 04, 2010, 09:42:55 AM
When I go to features and options, then to custom actions, I get this error:

Table 'kalyra_smf.smf_custom_actions' doesn't exist
File: /home/kalyra/public_html/forum/Sources/ManageSettings.php
Line: 2221


What does this mean?

I am using curve, RC2 2.0
Title: Re: Thank you Rumbaar for this Custom Action Mod
Post by: Sea Mac on February 24, 2010, 01:40:01 PM
Thank you for this Custom Action Mod!

It is very necessary!
Title: Re: Custom Action Mod -- error when I click custom actions
Post by: Largo_npc on March 03, 2010, 08:40:40 AM
Quote from: Josh79 on February 04, 2010, 09:42:55 AM
When I go to features and options, then to custom actions, I get this error:

Table 'kalyra_smf.smf_custom_actions' doesn't exist
File: /home/kalyra/public_html/forum/Sources/ManageSettings.php
Line: 2221


What does this mean?

I am using curve, RC2 2.0

Read a few posts above!

Or, run this inside your myphpadmin or whatever you use:

ALTER TABLE custom_actions RENAME TO smf_custom_actions;
Title: Re: Custom Action Mod
Post by: L'AltroWeb on March 30, 2010, 05:17:06 PM
Hi :)
I've maked more pages thanks to this mod but now i've a small(?) problem with one of this: http://darkwolf.altervista.org/videovalidator/
I want test to translate in english and to see in Ita or Eng thanks to language drop down.
I've maked a php custom action and i've test to use some string from "index.english.php" but not work.
Is there any way to fix this problem?
-
Edit: ok, i've changed, in CustomAction.template.php
// Show a custom action.
function template_main()
{
global $context;

to:
// Show a custom action.
function template_main()
{
global $context, $txt;

and now i can use $txt['string_from_indext_emplate'] ;)
-
Edit: a new problem found today :/
I've an html page than contain link like this:
<a href="http://darkwolf.altervista.org/_altervista_ht/hwu/hwu_menu_forum.xpi">it work fine but after first "save" (the page still continue to work with full link) the editor trunk link like this:
<a href="http://darkwolf.altervista.org/_altervista_ht/hwu/hwu_menu_.xpi">and after a new "save" (eg: for a new custom action) it will corrupt
(i think it don't glad many "underscore" _ in url) :/
Title: Re: Custom Action Mod
Post by: luismanson on April 06, 2010, 03:07:17 PM
Anyone tested this on RC3 ????
Title: Re: Custom Action Mod
Post by: Reko420 on April 08, 2010, 11:06:51 PM
anyone have a updated package to work with rc3 or do i have to manual edit files?
Title: Re: Custom Action Mod
Post by: Norv on April 11, 2010, 07:00:22 PM
The mod is not tested for RC3 currently. I will update it as soon as possible.
Title: Re: Custom Action Mod
Post by: KensonPlays on April 22, 2010, 05:35:10 PM
Can't wait to try it! I found a tinyportal (linked to a page their in a google search) script that will embed wikipedia into your site! http://www.tinyportal.net/index.php?topic=4713
Title: Re: Custom Action Mod
Post by: KensonPlays on April 22, 2010, 09:10:15 PM
It installed successfully on RC3, but had to emulate last version this was made for. I went to mod page and found where mod page in admin was, and no admin menu item was added!!
Title: Re: Custom Action Mod
Post by: deadeye536 on April 24, 2010, 10:22:07 PM
Quote from: Kcmartz on April 22, 2010, 09:10:15 PM
It installed successfully on RC3, but had to emulate last version this was made for. I went to mod page and found where mod page in admin was, and no admin menu item was added!!

I found the admin menu option, it's under "Features and Options." Move your mouse a bit to the right of "Profile Fields", and you'll see the hover effect, with no text within it. The entire admin page is one giant malfunction.

Edit
Hmm, the problem really seems to be with the language files. For instance, my forum is installed with English-UTF8, while the mod only installs to English. I just made the same changes to English-UTF8 as were made to English (keeping a careful eye on converting to UTF-8 without BOM).
Title: Re: Custom Action Mod
Post by: Rafferty on May 23, 2010, 09:15:29 AM
This really needs to be updated for RC3. Very useful, I used this before RC3 on 1.1.11 and have now lost all my custom actions.
Title: Re: Custom Action Mod
Post by: Scratching my Head on May 29, 2010, 09:48:21 PM
Quote from: Norv on April 11, 2010, 07:00:22 PM
The mod is not tested for RC3 currently. I will update it as soon as possible.


I'll do your laundry if you do...

Please?
Title: Re: Custom Action Mod
Post by: KensonPlays on May 29, 2010, 10:52:24 PM
Norv, I wonder, how do you add a sub-action, can't figure it out....
Title: Re: Custom Action Mod
Post by: Raw-Raven.co.nz on May 30, 2010, 03:06:43 PM
Hey all,

My first post, but i managed to get this mod going on
smf 2.0-rc3.

All that is need to do is two things,
First add the button under admin.php and the fix up that database table.


Changes in Admin.php

Find this line:
'profile' => array($txt['custom_profile_shorttitle'], 'enabled' => in_array('cp', $context['admin_features'])),

Add under line:
'action' => array($txt['custom_action_shorttitle'], 'admin_forum'),



Changes in Database:

Done with phpMyAdmin (don't ask how to use it please)
You will find in that database that it is listed as
"custom_actions"
You need to open the table then select the "Operations"
tab to edit the table name.
"smf_custom_actions"


This is all i have done to get this mod working.
Yet to make an action tab i must say,
so will post back if it 'fails'

#| EDIT.

Ok just worked out how to use it and it is working fine,
not what I'm looking for tho  ::)

Only problem i know of and that is it will not auto add a tab to your
tabs up top as it doesn't put a line in your Subs.php

So all you can just manually add in the tab into your Sub.php file,
as you will get the address code form the page when making it.

I'm not interested in finding out how to get it working in auto.
I would be adding it in like i said above.

Hope this will help you.
Title: Re: Custom Action Mod
Post by: Scratching my Head on May 31, 2010, 05:04:56 PM
Quote from: Raw-Raven.co.nz on May 30, 2010, 03:06:43 PM
Hey all,

My first post, but i managed to get this mod going on
smf 2.0-rc3.

All that is need to do is two things,
First add the button under admin.php and the fix up that database table.


Changes in Admin.php

Find this line:
'profile' => array($txt['custom_profile_shorttitle'], 'enabled' => in_array('cp', $context['admin_features'])),

Add under line:
'action' => array($txt['custom_action_shorttitle'], 'admin_forum'),



Changes in Database:

Done with phpMyAdmin (don't ask how to use it please)
You will find in that database that it is listed as
"custom_actions"
You need to open the table then select the "Operations"
tab to edit the table name.
"smf_custom_actions"


This is all i have done to get this mod working.
Yet to make an action tab i must say,
so will post back if it 'fails'

#| EDIT.

Ok just worked out how to use it and it is working fine,
not what I'm looking for tho  ::)

Only problem i know of and that is it will not auto add a tab to your
tabs up top as it doesn't put a line in your Subs.php

So all you can just manually add in the tab into your Sub.php file,
as you will get the address code form the page when making it.

I'm not interested in finding out how to get it working in auto.
I would be adding it in like i said above.

Hope this will help you.


I tried tinkering with this for a couple of days.
No luck.

Has anyone else had any successs?


I offer a 10 dollar ransom for this hostaged mod to be updated for SMF 2.0 RC3.

Anyone else?
Title: Re: Custom Action Mod
Post by: Raw-Raven.co.nz on May 31, 2010, 10:45:31 PM
Hello all,

I will put up a link to show you the custom action i have
made with the mod.

http://www.renegadesatwar.net/home/index.php?action=custom_action_test

Check the database to see if i has made the Table,
as after i made the link it said it was having problems
with Tables not existing, and that's when i found the
Table had been entered wrong.

It is a very good mod, but it is not what i wanted as
all of your page Code is kept in the Database Table.


Hope you get it working as well.
Thanks, Raven.
Title: Re: Custom Action Mod
Post by: Scratching my Head on June 01, 2010, 02:04:38 AM
Okay. I see it works on your forum.



I couldn't get it to work, and I didn't have a table called smf_custom_actions
May I ask you to please run through exactly what you did, step by step?

Title: Re: Custom Action Mod
Post by: Mave on June 01, 2010, 04:11:00 AM
Need RC3 PM me and send your email.
Title: Re: Custom Action Mod
Post by: Scratching my Head on June 01, 2010, 08:57:23 AM
You've got mail...
Title: Re: Custom Action Mod
Post by: Raw-Raven.co.nz on June 02, 2010, 07:10:01 PM
Hey all,

Probably going to get my profile banned
for this, but anyways here is what you guys have
been wanting.

I will be keeping this link active for a week or
less if requested by SMF/or Mod persons.

Custom Action Mod For 2.0RC3 (http://www.raw-raven.co.nz/downloads/Custom_Action_Mod/customaction_2.0RC3.zip)

This is only for RC3 and has only been tested on RC3.
I hope you enjoy.
Title: Re: Custom Action Mod
Post by: Norv on June 02, 2010, 07:17:29 PM
Thank you Raw-Raven, and Mave. Your help is appreciated, and by no means will get anyone banned. :)
I meant to update the mod on the site and change license to it, so that you don't need anything to take it over if you wish (including anyone's approval), or update it or share it when you want. I will try to do so as soon as possible, unless the sky falls tomorrow or the day after. :)
Title: Re: Custom Action Mod
Post by: Scratching my Head on June 02, 2010, 07:27:11 PM
Quote from: Raw-Raven.co.nz on June 02, 2010, 07:10:01 PM
Hey all,

Probably going to get my profile banned
for this, but anyways here is what you guys have
been wanting.

I will be keeping this link active for a week or
less if requested by SMF/or Mod persons.

Custom Action Mod For 2.0RC3 (http://www.raw-raven.co.nz/downloads/Custom_Action_Mod/customaction_2.0RC3.zip)

This is only for RC3 and has only been tested on RC3.
I hope you enjoy.

Works (touching tips of fingers to mouth and kissing) purrfect!

Title: Re: Custom Action Mod
Post by: Raw-Raven.co.nz on June 03, 2010, 07:10:50 PM
Glade it works for you.
*Scratching my Head*

With the mod all I've done with it was change the
way some things where coded and didn't bother
to credit myself, and don't want any.

Only did it for the peoples that where having trouble with it
and it is a nice mod.

I believe that i will use it and just use all includes on the
pages to reduce the size of my database.
Its a shame it don't make new pages  ;D
Title: Re: Custom Action Mod
Post by: Raw-Raven.co.nz on June 03, 2010, 07:16:19 PM
Quote from: Kcmartz on May 29, 2010, 10:52:24 PM
Norv, I wonder, how do you add a sub-action, can't figure it out....

OMG that one took me ages!!!!  :P

Under the "Sub-Actions" column, find the action you want to
make sub actions for and select that number "0"
It will then open up to the Adding sub-actions page!

Its a hard one!!!
Title: Re: Custom Action Mod
Post by: n3ith on June 04, 2010, 07:57:45 PM
This is by far my favorite mod. Thank you. Very easy to use. Appreciate all the hard work on this.
Title: Re: Custom Action Mod
Post by: qubbah on July 29, 2010, 12:32:45 PM
any update plz...
Title: Re: Custom Action Mod
Post by: KensonPlays on July 30, 2010, 11:37:24 PM
Quote from: Raw-Raven.co.nz on June 03, 2010, 07:16:19 PM
Quote from: Kcmartz on May 29, 2010, 10:52:24 PM
Norv, I wonder, how do you add a sub-action, can't figure it out....

OMG that one took me ages!!!!  :P

Under the "Sub-Actions" column, find the action you want to
make sub actions for and select that number "0"
It will then open up to the Adding sub-actions page!

Its a hard one!!!
It would be easier if it was a "+" or someting like that with the number of subactions as well!
Title: Re: Custom Action Mod
Post by: KensonPlays on July 30, 2010, 11:40:01 PM
Hey i tried the:
http:www.raw-raven.co.nz/downloads/Custom_Action_Mod/customaction_2.0RC3.zip
zip file. I still get the damn error. the button to add a action: [] is what it shows. dammit!

EDIT:
How do I remove the database tables without going into PHPmyadmin? what are the table names?

EDIT 2:
What is the SQL query for custom_actions? I deleted DB table and then deleted mod, then reinstalled mod. NO ERRORS for install, and looked and no DB table was made.
Title: Re: Custom Action Mod
Post by: KensonPlays on July 31, 2010, 03:52:45 PM
Sorry to bump so soon. This mod is a must for my website! I don't want to do a fresh install for the 20th time unless I have to...
Title: Re: Custom Action Mod
Post by: ameo on August 28, 2010, 12:46:08 PM
1.
hey, does anyone know why I get this error:

Not Acceptable
An appropriate representation of the requested resource /forum/index.php could not be found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

when I'm trying to delete a block. And can it be deleted manually, if nothing helps.

2. Also, why, when I set block to be php, and input this : <?php include("/home/ameo/public_html/pulse/blocks/skyline.html"); ?>
I get Parse error: syntax error, unexpected '<' in /home/ameo/public_html/forum/Sources/Load.php(1733) : eval()'d code(9) : eval()'d code on line 1
Title: Re: Custom Action Mod
Post by: L'AltroWeb on September 03, 2010, 08:58:00 AM
Quote from: Dark-Wolf on March 30, 2010, 05:17:06 PM
I've maked a php custom action and i've test to use some string from "index.english.php" but not work.
Is there any way to fix this problem?
-
Edit: ok, i've changed, in CustomAction.template.php
// Show a custom action.
function template_main()
{
global $context;

to:
// Show a custom action.
function template_main()
{
global $context, $txt;

and now i can use $txt['string_from_indext_emplate'] ;)
Title: Re: Custom Action Mod
Post by: KensonPlays on September 03, 2010, 01:25:45 PM
I would love this, but the buttons on the page have no text in it, for one, and when I click them nothing happens.
Title: Re: Custom Action Mod
Post by: Norv on September 21, 2010, 08:42:53 PM
Kcmartz: Please, try the last version.

Dark-Wolf: Sorry for the delay. Good to see you worked it out, and thank you very much for sharing it. :)

ameo: it sounds like mod_security is installed on your host's Apache server. Maybe contacting them and telling them the URL causing the problem would help them identifying the rule and eventually making an exception.
Title: Re: Custom Action Mod
Post by: Joe_Dean on October 23, 2010, 09:27:54 AM
Nice mod! But where does it store the code? MySQL? Or does it create a file somewhere?

I just can't stand having to add PHP code to a tiny text box rather than editing a file (which would be easier). Any alternatives?


EDIT: I'll just call to a function specific to each action inside the code box and create a php file with all the functions (hence editing files instead of using these small text boxes lol)
Title: Re: Custom Action Mod
Post by: KensonPlays on November 03, 2010, 10:43:17 AM
When will this have support for RC4? I am waiting until my main modifications (the important ones) have RC4 support before I upgrade. This is holding me back.
Title: Re: Custom Action Mod
Post by: KensonPlays on November 05, 2010, 01:00:01 PM
Sorry for double post. I installed no errors, and looks fine on RC4!!
Title: Re: Custom Action Mod
Post by: Norv on November 05, 2010, 01:03:14 PM
Thank you for the feedback. I didn't have time to test it too, but will do.
Title: Re: Custom Action Mod
Post by: KensonPlays on November 05, 2010, 03:25:06 PM
no problem glad to help!
Title: Re: Custom Action Mod
Post by: KensonPlays on November 05, 2010, 03:25:26 PM
********n phone. please delete all but post above this**
Title: Re: Custom Action Mod
Post by: KensonPlays on November 05, 2010, 03:29:05 PM
**please delete, see below post**
Title: Re: Custom Action Mod
Post by: KensonPlays on November 05, 2010, 03:30:19 PM
**please delete, my phone sometimes double submits forms**
Title: Re: Custom Action Mod
Post by: Robert. on November 05, 2010, 03:34:16 PM
Kcmartz, stop this :(
Title: Re: Custom Action Mod - PHP Linking
Post by: Mike Stowe on November 21, 2010, 05:07:48 AM
Hi,

I really love this mod!!! Its making my life so much easier!

I'm having some trouble linking to a photo gallery though. I don't know any php at all and somehow I managed to get this photo gallery installed but I can't figure out how to link to it through the mod.



http://www.wararmada.com/screenshots/index.php



The screenshots folder is in the public-html folder with the rest of my SMF stuff.

Thanks for any help.
Title: Re: Custom Action Mod
Post by: Mike Stowe on November 21, 2010, 05:27:38 AM
Sorry another question.

If i want to display a custom page as the home page do i need to instill the forums in a sub folder?

Thanks
Title: Re: Custom Action Mod
Post by: inflatablemouse on November 21, 2010, 03:50:40 PM
Never mind, I stopped using this.
Title: Re: Custom Action Mod
Post by: Mike Stowe on November 26, 2010, 03:44:38 PM
How do i add sub actions?

I'm trying to add dropdown links to my overvew button.

I'm going to

http://www.wararmada.com/smf/index.php?action=overview;sa=""""The name I want to use on the button"""""".

and the page is not found.

I've tried adding a page using them info but it tells me

QuoteAction URLs may only contain letters, numbers and underscores.

The code i've been trying to use to add the sub action is

overview;sa=corpmerger

Thanks for the help!
Title: Re: Custom Action Mod
Post by: NanoSector on November 26, 2010, 03:55:17 PM
works fine in RC4. No need to emulate, either.
Title: Re: Custom Action Mod
Post by: Shalika on December 20, 2010, 12:38:14 PM
I installed it on 1.1.12 .. it passed all tests and got installed.
Now I don't see any link in Features and Options other than

Basic Features | Layout and Options | Karma

How to fix this ?


Oh I'm sorry.. I reinstalled and got it working.
Title: Re: Custom Action Mod
Post by: eyo on December 22, 2010, 08:40:50 AM
my html and bbc stuff have disappeared lately for some reason i dunno(i checked everything in the forum posting admin section)

im afraid of installing this as a "solution" for my current problem, but can this help? btw i got this during install, is this a green light?(rc4)

1.    Adapt Database    install.php    
   2.    Extract File    ./Sources/CustomAction.php    
   3.    Extract File    ./Themes/default/CustomAction.template.php    
*    4.    Execute Modification    ./Sources/ManageSettings.php    Test successful
      1.    Replace    ./Sources/ManageSettings.php    Test successful
      2.    Replace    ./Sources/ManageSettings.php    Test successful
      3.    Add Before    ./Sources/ManageSettings.php    Test successful
*    5.    Execute Modification    ./Sources/Admin.php    Test successful
      1.    Add Before    ./Sources/Admin.php    Test successful
*    6.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful
      1.    Add Before    ./Themes/default/languages/Modifications.english.php    Test successful
   7.    Execute Modification    ./Themes/default/languages/Modifications.german.php    Skipping file
   8.    Execute Modification    ./Themes/default/languages/Modifications.german-utf8.php    Skipping file
*    9.    Execute Modification    ./Sources/Subs.php    Test successful
      1.    Replace    ./Sources/Subs.php    Test successful
*    10.    Execute Modification    ./index.php    Test successful
      1.    Replace    ./index.php    Test successful
*    11.    Execute Modification    ./Themes/default/Admin.template.php    Test successful
Title: Re: Custom Action Mod
Post by: NanoSector on December 22, 2010, 08:47:52 AM
This won't help with the problem you are having.

Though I don't see anything bad in the test results.
Title: Re: Custom Action Mod
Post by: eyo on December 22, 2010, 09:11:40 AM
do you have an idea what made my editing options in bbc or html have gone?
Title: Re: Custom Action Mod
Post by: NanoSector on December 22, 2010, 09:28:36 AM
Quote from: ggman on December 22, 2010, 09:11:40 AM
do you have an idea what made my editing options in bbc or html have gone?
I absolutely have no idea.

Maybe upload a fresh Post.Template.php to your Themes/Default folder.

Warning: This will remove all BBC editing options from the menu.
Title: Re: Custom Action Mod
Post by: Kratty256 on December 27, 2010, 10:57:46 PM
This is a WONDERFUL mod! I'm using it and having a blast with it!

Quick question though - how do the sub-actions work? I made one and can't seem to be able to find out how to get to it.
Title: Re: Custom Action Mod
Post by: NanoSector on December 28, 2010, 03:12:52 AM
Quote from: Andrew94 on December 27, 2010, 10:57:46 PM
This is a WONDERFUL mod! I'm using it and having a blast with it!

Quick question though - how do the sub-actions work? I made one and can't seem to be able to find out how to get to it.
I didn't see anyone to have them working, though.
Title: Re: Custom Action Mod
Post by: Kratty256 on December 28, 2010, 11:51:39 AM
I figured it out, it's ;sa=subaction

Example:
http://youwebsite/index.php?action=firstaction;sa=subaction
Title: Re: Custom Action Mod
Post by: cloksin on December 31, 2010, 12:00:48 AM
I have a request.  I took over a site for someone who unfortunately is no longer with us.  The site uses simpleportal and has a menu block on the left hand side with all kinds of things in it.  One of the things I need help with are some navigation links that were created using a custom action, unfortunately that custom action got lost in a server crash and I have no idea how to recreate it.  What I am trying to do is create links that my users can use to get to "Topics - Last 50", "Topics - Last 24 hrs", "Topics - You're Watching", "Topics - You've Bookmarked", and "Topics - Unreplied".  This is the code I have in the simpleportal block:

global $context, $settings, $options, $scripturl, $txt, $modSettings, $user_info, $db_prefix, $smcFunc;

// Shows for everybody
echo '<a href="', $scripturl, '?action=links">Links</a><br />';
echo '<a href="', $scripturl, '?action=contact">Contact Webmaster</a>';

// Guests
if ($user_info['is_guest']) {
echo '<center>';
echo '<strong>Registration requires a <u>valid</u>, <u>active</u> email address!!!</strong><br />';
echo '</center>';
echo '<hr>';
}

// Logged in Users (with one line checking for membergroup 13)
if (!$user_info['is_guest']) {
echo '<a href="', $scripturl, '?action=dxrecent;style=full;type=last">Topics - Last 50 </a><br />';
echo '<a href="', $scripturl, '?action=dxrecent;style=full;type=hours">Topics - Last 24 hrs</a><br />';
echo '<a href="', $scripturl, '?action=dxrecent;style=full;type=notify">Topics - You\'re Watching</a><br />';
echo '<a href="', $scripturl, '?action=dxrecent;style=full;type=bookmark">Topics - You\'ve Bookmarked</a><br />';
if (in_array(13, $user_info['groups'])) {
echo '<a href="', $scripturl, '?action=dxrecent;style=full;type=unreplied">Topics - Unreplied</a><br />';
}

// Admin only
if ($user_info['is_admin']) {
echo '<a href="', $scripturl , '?action=admin;area=viewmembers;sa=browse;type=activate', '">', sprintf($txt['admin_browse_awaiting_activate'], $context['awaiting_activation']), '</a><br />';
}




The custom action in question in this case is "dxrecent".  Would someone be able to tell me how to create this action from seeing how it will be used?
Title: Re: Custom Action Mod
Post by: eyo on January 03, 2011, 08:39:13 AM
ok i tried putting a url in the html headers and i noticed the title became a button and went to the action(webpage) i wanted it to, what do i put in the action url?     "Action URLs may only contain letters, numbers and underscores." i keep getting this argh i keep getting taken to the index page asldfksd;kfhasofskodf
Title: Re: Custom Action Mod
Post by: eyo on January 03, 2011, 07:58:27 PM
how does one put a sub action? can anyone here give an exampe?
Title: Re: Custom Action Mod
Post by: cloksin on January 07, 2011, 10:57:26 AM
bump
Title: Re: Custom Action Mod
Post by: Kratty256 on January 08, 2011, 12:57:10 PM
Quote from: eyo on January 03, 2011, 07:58:27 PM
how does one put a sub action? can anyone here give an exampe?

Go to Custom Actions under features and options. You should there see:
Action Name | Type | Sub-Actions | Enabled | Modify

There will be a number (0+) underneath Sub-Actions, click it to make your sub-action for the primary action.
Title: Re: Custom Action Mod
Post by: eyo on January 10, 2011, 07:57:53 PM
i dont see any sub-actions option anywhere only actions :(
Title: Re: Custom Action Mod
Post by: Phat^Trance on January 23, 2011, 12:56:21 PM
does this mod allow only admins to add the bbc code?
Title: Re: Custom Action Mod
Post by: kingkingston on January 24, 2011, 05:14:02 AM
had this problem

Fatal error: Cannot redeclare template_show_custom_action() (previously declared in /home/nbathrea/public_html/Sources/Load.php(2144) : eval()'d code:2155) in /home/nbathrea/public_html/Sources/Load.php(2144) : eval()'d code on line 2296

Title: Re: Custom Action Mod
Post by: NanoSector on January 30, 2011, 05:11:57 AM
Quote from: kingkingston on January 24, 2011, 05:14:02 AM
had this problem

Fatal error: Cannot redeclare template_show_custom_action() (previously declared in /home/nbathrea/public_html/Sources/Load.php(2144) : eval()'d code:2155) in /home/nbathrea/public_html/Sources/Load.php(2144) : eval()'d code on line 2296
Can you post your Load.php file, please?
Title: Re: Custom Action Mod
Post by: Masterd on January 30, 2011, 05:34:31 AM
No. That's an evaluation error.
Title: Re: Custom Action Mod
Post by: NanoSector on January 31, 2011, 12:26:41 PM
Quote from: Masterd on January 30, 2011, 05:34:31 AM
No. That's an evaluation error.
So? It's still an error that needs to be fixed.
Title: Re: Custom Action Mod
Post by: Biology Forums on April 18, 2011, 10:05:12 PM
Can anyone tell me how I can embed another website within the code space? Would I use "html" and what code would I have to use?
Title: Re: Custom Action Mod
Post by: Rumbaar on April 18, 2011, 11:17:34 PM
Quote from: shuban on April 18, 2011, 10:05:12 PM
Can anyone tell me how I can embed another website within the code space? Would I use "html" and what code would I have to use?
Well that's basic HTML knowledge that is beyond the scope of mod support here.  But you can use an iframe.  It can also depend on the target site, they might have code specific for embedding their content.
Title: Re: Custom Action Mod
Post by: Biology Forums on April 20, 2011, 06:40:33 PM
I don't believe this, you guys are php gurus and you no one can give me instructions on how to embed another website into the space provided? :o :-[
Title: Re: Custom Action Mod
Post by: Scratching my Head on April 20, 2011, 10:54:22 PM
Hey, Shuban:

<iframe height="410" width="100%" frameBorder="0" src="http://www.YOUR-WEBSITE">your browser does not support IFRAMEs</iframe>

Use that. Just put it in the HTML BODY section of the custom action mod.
No need to do anything with the HEADERS part of the mod.

Make sure it's HTML (type).

You should be good to go.

Hope that helps.
Title: Re: Custom Action Mod
Post by: Biology Forums on April 21, 2011, 07:04:44 PM
Quote from: Scratching my Head on April 20, 2011, 10:54:22 PM
Hey, Shuban:

<iframe height="410" width="100%" frameBorder="0" src="http://www.YOUR-WEBSITE">your browser does not support IFRAMEs</iframe>

Use that. Just put it in the HTML BODY section of the custom action mod.
No need to do anything with the HEADERS part of the mod.

Make sure it's HTML (type).

You should be good to go.

Hope that helps.

Scratching my Head, you're incredible. Thank you :)
Title: Re: Custom Action Mod
Post by: Scratching my Head on April 21, 2011, 07:15:18 PM
Sure.
Title: Re: Custom Action Mod
Post by: -=[Vyorel]=- on May 05, 2011, 08:18:11 PM
Very nice mod!

For new version i have one idea:
Add group permission for edit pages from Custom Actions





Thanks!
Title: Re: Custom Action Mod
Post by: MrMorph on May 06, 2011, 11:17:06 AM
Did anyone try this on RC5 ?
Title: Re: Custom Action Mod
Post by: Masterd on May 06, 2011, 11:49:01 AM
It's working without any problems on SMF 2.0 RC5.
Title: Re: Custom Action Mod
Post by: MrMorph on May 06, 2011, 11:55:34 AM
Great thanks :)
Title: Re: Custom Action Mod
Post by: Masterd on May 06, 2011, 11:56:09 AM
No problem! ;)
Title: Re: Custom Action Mod
Post by: firechild on June 05, 2011, 06:54:23 AM
Tremendous Mod. Thanks very much.

I have just moved my forum to a new server, and everything seems to have transferred fine. But when I went to edit the Custom Actions Page I get a "You do not have permission" error message. Any ideas what might be causing that?

Version 1 of SMF, btw.

Cheers
Title: Re: Custom Action Mod
Post by: Shorti25 on June 26, 2011, 07:47:34 AM
does it run with 2.0 gold ?
Title: Re: Custom Action Mod
Post by: Masterd on June 26, 2011, 09:01:39 AM
Yes, it works without any problems.
Title: Re: Custom Action Mod
Post by: firechild on June 26, 2011, 07:19:29 PM
Quote from: firechild on June 05, 2011, 06:54:23 AM
Tremendous Mod. Thanks very much.

I have just moved my forum to a new server, and everything seems to have transferred fine. But when I went to edit the Custom Actions Page I get a "You do not have permission" error message. Any ideas what might be causing that?

Version 1 of SMF, btw.

Cheers
No thoughts on this?
Title: Re: Custom Action Mod
Post by: Nomadic on July 05, 2011, 05:42:25 PM
Quick question for you. I'd like to call SSI and other variables inside of a custom action so that I can grab someone's name or check if they are logged on, etc. Is this possible? The code in question:


echo '<iframe width="100%" height="600" src="http://widget.mibbit.com/?settings=4f9c0ee511c70e93a60faa57c6d7ba77&server=otherworlders.org&channel=%23thecbg&nick=' . $user_info['username'] . '"></iframe>';


I originally assumed that as the actions are called inside the main index page which already includes those variables that I could just pull them out however that doesn't seem to be working. Additionally when I try to include SSI.php inside the action itself it creates an error. Is it possible to do this? Essentially the purpose here is to have it so that if they go to the IRC page they get a mibbit chat window with their username already in the nickname box ready to go. Once this is working I'd also like to use those variables to run a check on whether or not they are logged in (and if not give them a "you must be logged in" message).
Title: Re: Custom Action Mod
Post by: TheListener on July 23, 2011, 06:12:37 PM
Can someone help with ther error I mention in this post.

http://www.simplemachines.org/community/index.php?topic=443537.0

I believe it to be related to this mod.
Title: Re: Custom Action Mod
Post by: Stumpy on July 27, 2011, 11:50:23 AM
Can somebody give me an example of using this mod to update an existing table using values from a form?  The mod works great for me to display query results from a table (a schedule), but I can't figure out how to display a form with a submit button which runs an update query on a specific record.   Say for example that I show the schedule for a Monday and I want to update the time that lunch is scheduled?

I think I'm pretty close to doing what I want, but I'm stuck.  If somebody could show me some example code to do this, I'd really appreciate it!
Title: Re: Custom Action Mod
Post by: Chaotix on August 19, 2011, 06:54:34 AM
Hi,

I want to create a custom BBC tag.  Is it possible using this mod?  also could someone give me a quick example of how to create a custom bbc tag using this mod?


Thanks
Title: Re: Custom Action Mod
Post by: mxcape21 on August 23, 2011, 11:14:00 PM
I'm not sure if this mod will help me or not...
I am trying to create a theme select and would love to be able to install it as a mod, added to template but I will settle for a manual file edit that won't wreck my forum like I almost did already....I know very little about coding, just enough to be a danger to a perfectly running site...  ;D
This little js form works and changes my themes on SMF2.0 latest vers. but I need help to add it to my template...I have tested it in add management, custom box, header mod ect., but I want to add it to the very bottom left of template without relying on poorly postioned ad mod to place it.
Anyway here is the js form button that I want on my templates at the bottom left corner -->

Thanks in advance for any help you may be able to offer.
Running SMF 2.0 latest vers. w/Curve themes



<SCRIPT LANGUAGE="javascript">

function LinkUp()
{
var number = document.DropDown.DDlinks.selectedIndex;
location.href = document.DropDown.DDlinks.options[number].value;
}
</SCRIPT>

<FORM NAME="DropDown">
<select name="DDlinks">
<OPTION SELECTED>  - Theme -
    <option value="url/w_action(see_last_option)"> my Theme#1 here
    <option value="url/w_action(see_last_option)"> my Theme#2 here
    <option value="url/w_action(see_last_option)"> my Theme#3 here
    <option value="url/w_action(see_last_option)"> my Theme#4 here
    <option value="url/w_action(see_last_option)"> my Theme#5 here
    <option value="url/w_action(see_last_option)"> my Theme#6 here
    <option value="url/w_action(see_last_option)"> my Theme#7 here
    <option value="http://mysite.com/forum/index.php?action=my_action;my_theme=#here
"> Green
</select>
<INPUT TYPE="BUTTON" VALUE="Click to Go!" onClick="LinkUp()">
</form>




Thanks
Title: Re: Custom Action Mod
Post by: want2live on October 19, 2011, 07:48:04 PM
Anybody ?

When I move this code in SUBS.php:

// Any custom action buttons?
$ca_buttons = unserialize($modSettings['ca_menu_cache']);
foreach ($ca_buttons as $button)
{
$buttons[$button[0]] = array(
'title' => $button[1],
'href' => $scripturl . '?action=' . $button[0],
'show' => $button[2] ? allowedTo($button[2]) : true,
'sub_buttons' => array(
),
'is_last' => true,
);
}



before or after e.g. forum tab I have "sytanx" error. Anybody knows how move those custom tabs around ?

Title: Re: Custom Action Mod
Post by: want2live on October 20, 2011, 07:03:42 AM
Lol

I supported my self - little bit around but it works. So whoever will have an issue like me:

1. create a custom action
2. in options of custom action mod - un-tick "show the button"
3. separately go to subs.php and create manually extra button
4. use the action created previously as href

Thank you for support :)
Title: Re: Custom Action Mod
Post by: DanCarroll on October 24, 2011, 08:09:35 AM
Has anyone modded this Mod to get it to work with the Package Manager for SMF 2.0.1? Or is manual installation the only option?
Title: Re: Custom Action Mod
Post by: cloksin on October 24, 2011, 09:47:51 AM
On your forum, go to Admin -> Package Manager -> Browse Packages

Once there, scroll to the bottom, click the "advanced" link, change the version to an earlier version, e.g. SMF 2.0, or SMF 2.0 RC5. Click the "Apply" button and try reinstalling the mod.  This should work.  Make sure when you are done you revert your settings back to the default.
Title: Re: Custom Action Mod
Post by: DanCarroll on October 24, 2011, 10:00:04 AM
Thanks for the reply but I have already tried that option. It doesn't appear as though this mod is configured to work with the Package Manager?
Title: Re: Custom Action Mod
Post by: cloksin on October 24, 2011, 10:26:39 AM
emulate SMF 2.0 RC4 - see if that works for you.  Or you could open up the zip file for the package, then edit package-info.xml, find all instances of this:

install for="2.0 RC4 - 2.0.99"

and replace it with:

install for="2.0.1"

Then zip it all back up and try again, with your emulator reverted back to default
Title: Re: Custom Action Mod
Post by: DanCarroll on October 24, 2011, 01:01:47 PM
Okay cloksin, I will give it a try. Thanks!

EDIT: That did it. Thanks again cloksin.
Title: Re: Custom Action Mod
Post by: DanCarroll on October 24, 2011, 05:03:27 PM
This mod is cool. I have a BBC action working. Now what do I have to do to get a PHP action working?

The PHP code I have is good. I coded a simple action and template by hand and it tests good. But using the same code in the Custom Action Mod doesn't work. I'm sure its something simple with the PHP wrapper code maybe? I just haven't found any good instructions or samples to follow.

Help?

EDIT:  Okay, got it working. Have to leave out the SMF specific code.
Title: Re: Custom Action Mod
Post by: DanCarroll on October 25, 2011, 01:58:12 PM
Making Link Tree work with Custom Action Mod.

I thought about setting this up by extending this mod but I tested it out in the mod's code window for a new action and it works.
Maybe I should find a need before trying to fulfill it but since I had a bit of a trial-and-error session myself, here it is.

In the Source File Code window:

$context['linktree'][] = array(
'url' => $scripturl. '?action=test_php',
'name' => 'TestPHP',
);


    the action=youraction should be easy enough to understand;
    the name 'TestPHP' can be anything you want it to be.

This also works with subactions. You will need to copy the above code into your Source File Code window and another version of it for the sub-action.
See the code below:

$context['linktree'][] = array(
'url' => $scripturl. '?action=test_php',
'name' => 'TestPHP',
);

$context['linktree'][] = array(
'url' => $scripturl. '?action=test_php;sa=subtestphp',
'name' => 'SubTestPHP',
);


An anchor link to the sub-action in the Template Code section of your custom action:

echo '
    <a href="index.php?action=test_php;sa=subtestphp">Go to Sub-action test.</a>
';


Hopefully this helps someone. I had to go through a long process of hand-crafting a custom action to understand how all of the parts worked.
Custom Actions with Link Tree. Cool way to go.

Title: Re: Custom Action Mod
Post by: Adrek on November 26, 2011, 06:18:15 AM
There is some error in package customaction3.2.zip, when I try to download it through 'Package Manager' it throws out error:


But when I repack it to *.zip and download it then it works.
Title: Re: Custom Action Mod
Post by: Jeff B on November 30, 2011, 02:54:12 PM
I'm wondering if anyone can help me figure this out.  I am trying to use the custom action function to add some calculators to my site.  In the head area, I had the script source, and in the body, I add the code to follow. What happens after I save it, is that part of the code, actually becomes part of the custom actions page, and I can not modify, or delete the custom action.  The page works, but it breaks the mod.  I have to go into PHPMyAdmin and delete the custom action from the custom actions table.

I tried it without putting the script in the head, and it does the very same thing.  I'll attach the code that breaks the mod, and also a screen shot for you to see what is happening.  I'm guessing this could be considered a bug. What to look for in the screenshot is under the post box, part of the form becomes part of the mod page, rendering it inoperable.


        <form name="spec">
            <input type="text" name="depth" size="2"> Thickness in inches
            <input type="text" name="width" size="2"> Width in inches
            <input type="text" name="length" size="2"> Length in feet<br>

            <input type="text" name="piece" size="2"> Number of pieces
            <input type="text" name="Bpackage" value="1" size="2"> Number of packages*
            <input type="text" name="cost" value size="4"> Price per/Mbf<br>
            </font></p>
          <p align="center"><font face="Arial" size="2"><small>*If package number
            is not applicable, leave number at 1</small><br>


            </font></p>
            <div align="center"><font face="Arial" size="2">
              <input type="button" name="answer" value="Calculate and add lumber to total" onClick="updateAnswer();">
              <br>
              <br>
              Lumber entered list:<br>
              <textarea name="list" cols="50" rows="2"></textarea>
              <br>

              Total board footage:
              <input type="text" name="answerTotal" value="0" size="10">
              Total Price $
              <input type="text" name="price" value="0" size="5">
              <input type="button" name="Confirmreset" value="Reset" onClick="if( confirm('Are you sure you want to reset?') ) {resetFormData(); }">
              </font></div>

</form>

Title: Re: Custom Action Mod
Post by: andershz on December 02, 2011, 02:27:01 PM
I suspect that the mod incorrectly interprets the </textarea> tag as the end of its own <textarea> where you enter your code rather than the end of the <textarea> in your code.
Try temporarily removing <textarea name="list" cols="50" rows="2"></textarea> from the code and see if it helps.
You could also try replacing </textarea> with &lt;/textarea&gt;
Title: Re: Custom Action Mod
Post by: Jeff B on December 02, 2011, 03:30:49 PM
Yup, that is the culprit, however &lt;/textarea&gt; does not seem to be the answer. It renders the calc inoperable.

The custom action page performs just fine once created, its just the only way to edit or delete it is within phpmyadmin.  :-\
Title: Re: Custom Action Mod
Post by: andershz on December 16, 2011, 04:34:53 PM
The mod adds the line below to Themes/default/Admin.template.php, (line 2323 in my version).
<textarea name="body" rows="20" cols="60">', $context['action']['body'], '</textarea>

If that line is replaced with
<textarea name="body" rows="20" cols="60">', htmlspecialchars($context['action']['body']), '</textarea>
it seems to work.
Title: Re: Custom Action Mod
Post by: Jeff B on December 16, 2011, 05:09:47 PM
Excellent!  Seems to work perfectly. Thank you very much.  :)
Title: Re: Custom Action Mod
Post by: dwd2000 on December 22, 2011, 07:08:28 PM
SMF 2.0.1, Custom Action 3.2

I have some scripts (complete programs, like chess, checkers, etc.) I'd like to run via Custom Action, but some have their own log in, and others don't.
I'd like the scripts to be run using the SMF user system automatically, like a separate mod, I guess.
Would the code in the following quote help, or is there more to it?


Quote from: worm82075 on March 17, 2008, 08:47:48 AM
Awesome Mod, works like a charm, so I have no problem with it's function, my question is about it's use.

Ok, I have archived another site and what I'm working with is about 370 static html pages with css formating. I can see the ability to add the existing code to custom actions editing all links to point to those actions there by integrating the static set into my 1.1.4 SMF forum and it acting as it did before accept it will be surrounded by my header and footer. Ok, that is nearly perfect except I don't want to let guests have access to those actions. From what I've gathered from this thread is that making the action Php rather than Html will give me the ability to put a user check in every action. While I am fairly proficient with html I am not very familiar with  Php as of yet. I have a deadline to meet on the construction of my site otherwise I would just be learning Php and doing this on my own.

My question is this, Is it possible for me to create the action as php, giving me my user check and then have it parse Html code to construct the page. Or alternatively is there a program available that can convert my html code to php.

Any help concerning the possession and regulation of standard html code by SMF would be appreciated. From what I gathered so far in the past 24 hours scouring this site for anything related to this subject is all the solutions in involve transforming my html code to php. Alright well there you have it, I'm sure someone here can enlighten me as to all my options so I can then decide what the best course of action will be.

Thanks.
Jeremy aka Worm

EDIT:I have located a program to convert my html to php and it works!

So all I really need now is a snipet to place at the beginning of my code to dis allow guests.

EDIT 2:ok, I managed to scrounge the first part and it works right
if ($context['user']['is_guest'])
echo "You <FONT color=#ff0000><b>MUST</b></FONT> be a registered member of this site to enter this archive.<BR><BR><BR>";
else


i just need to be able to kill it at this point if guest checks true

EDIT 3: Well that didn't take much time
if ($context['user']['is_guest'])
die('Direct Access to this location is not allowed.');
else


I have been at this site at least a half a dozen times for help. This is the first time I actually posted thinking what i needed wasn't here. Just took me a little longer to find it this time thats all. Leave it to a bunch of forum creators to set the example of how to run a tight ship. Thanks
Title: Re: Custom Action Mod
Post by: geek_andy on February 20, 2012, 07:57:26 AM
Quote from: DanCarroll on October 25, 2011, 01:58:12 PM
Hopefully this helps someone. I had to go through a long process of hand-crafting a custom action to understand how all of the parts worked.
Custom Actions with Link Tree. Cool way to go.

Cool way indeed, very useful, could a link to this be added to the first post? Save others from searching through the pages for the useful bits.

Thanks  ;)
Title: Re: Custom Action Mod
Post by: Norv on February 21, 2012, 11:08:01 AM
Done, thanks for the feedback, geek_andy.

And in particular, thanks to DanCarroll for the time spent on it and for sharing his experience.
Title: Re: Custom Action Mod
Post by: SRaven on April 08, 2012, 02:02:21 AM
This mod works great!
I have a question though that I hope someone can answer for me.

This is what I have in the 'body' part:

<iframe src="http://webchat.nightstar.net/?channels=darkwaters&uio=d4" width="647" height="400"></iframe>

My question is, what do I add to this to have it a popup window instead of being in the forum page?
Title: Re: Custom Action Mod
Post by: abraamz on April 23, 2012, 05:03:49 PM
I want to use this mod to add as custom action an application made with zend framework. Can this be done?
Can anyone please share a quick solution or post some related "reading" material?
Title: Re: Custom Action Mod
Post by: Westwegoman on May 12, 2012, 08:13:11 PM
I installed this mod and made a test page, but when I go to it I get the following error in my error log.

8: Undefined index: level
File: /homepages/13/xxxxxxxxxx/htdocs/xxxxx/community/Sources/menu_source/resources/main.php
Line: 994

Any ideas?

If it helps, line 994 of that file is as follows:
if (!empty($temp['strstr'][$key]) && $temp['strstr'][$key] == $context['current_action'] && $value['level'] == 0)
Title: Re: Custom Action Mod
Post by: UNeverNo on July 01, 2012, 01:49:24 AM
I want to add an imprint to my forum as required here in good old germany :-\

I read that this should be easy to achieve with this tool (otherwise I need to update all themes as it seems).

I got an imprint as .php-file - how can I do this now?

Can I chose type = PHP and do an include 'myfile.php'; in the Source File Code-field? Do I need to define an Action URL? I think I don't need it, I just want a new menu entry in the main menu...

A simple tutorial would be quite useful, is there maybe some that I haven't found?

edit:
Got it:

Title: Re: Custom Action Mod
Post by: NanoSector on July 01, 2012, 09:45:10 AM
Hey UNeverNo,

Does the script output something? If so, put it in the template box.

Just place it like this:
<?php

// $boarddir contains the path to the SMF directory, so perhaps it's /var/www/smf
global $boarddir;

include 
'MyFile.php';

?>


Good luck!
Title: Re: Custom Action Mod
Post by: poda19 on July 10, 2012, 06:45:02 AM
hi
i get this error when i submit my custom action
Quotedatabase error:
Unknown column 'permissions_mode' in 'field list'
file: C:\AbyssRoot\htdocs\Forum\Sources\ManageSettings.php
line: 2396
can anyone help?
**EDIT:fixed it. smf_customaction table didn't have the permissions_mode column and i added it manually
Title: Re: Custom Action Mod
Post by: DietmarH on September 05, 2012, 12:42:36 PM
Quote from: Andrew94© on December 28, 2010, 11:51:39 AM
I figured it out, it's ;sa=subaction

Example:
http://youwebsite/index.php?action=firstaction;sa=subaction
I found this, too. But why doesn't appear it as a sublist like under "admin", members" etc.?
Title: Re: Custom Action Mod
Post by: iain sherriff on September 22, 2012, 06:36:58 AM
hello.
Ive tried a search but can get my answer.
I have installed the mod with no errors and it works, Thank yuo for it.

Can I use it with existing actions? (as an Easy way of adding button to the menu)

thanks
Title: Re: Custom Action Mod
Post by: tMicky on October 12, 2012, 02:40:16 PM
Hello,

Is there a way to know the number of views a page with Custom Action Mod has?

thanks
Title: Re: Custom Action Mod
Post by: NanoSector on October 13, 2012, 06:08:16 AM
You'll have to code a custom ticker for that, I'm afraid.
Title: Re: Custom Action Mod
Post by: tMicky on October 13, 2012, 06:41:02 AM
Quote from: Yoshi2889 on October 13, 2012, 06:08:16 AM
You'll have to code a custom ticker for that, I'm afraid.

thanks for replying. Sadly, I know nothing about coding.
Title: Re: Custom Action Mod
Post by: NanoSector on October 13, 2012, 07:16:54 AM
I'm sure someone is able to assist you with this, try posting in the Help Wanted board.
Title: Re: Custom Action Mod
Post by: bigjoe11a on October 31, 2012, 04:04:52 AM
This may be a bum question. When I make a new PHP action. Do I have to add the PHP tags for both the source and the template.

Thanks
Title: Re: Custom Action Mod
Post by: bigjoe11a on October 31, 2012, 04:11:34 AM
Quote from: tMicky on October 12, 2012, 02:40:16 PM
Hello,

Is there a way to know the number of views a page with Custom Action Mod has?

thanks

Micky, If this is what you want to do. I would just go all the way, Using PHP code. in your source. You could keep track of every one that runs the action.

So create a new table. and add these fields

id => (int)(11)  //Record id
u_id => (int)(11) //Users ID
u_name => (string)(50) //Users Name
u_views => (int)(11) // Count the number of time this user ran this action
u_date  => (int)(25) // Update the date and time the user ran the action

Then every time the user ran this action. Update the record. If no record is fount. Then create a new record.

Then create a new sub action, and call it sa=actionAdmin and this is where you could see the results of who entered the action and now many times the users ran the action.

Title: Re: Custom Action Mod
Post by: andershz on October 31, 2012, 02:17:23 PM
Quote from: bigjoe11a on October 31, 2012, 04:04:52 AM
This may be a bum question. When I make a new PHP action. Do I have to add the PHP tags for both the source and the template.

Thanks

No php tags in either source or template.
Title: Re: Custom Action Mod
Post by: bigjoe11a on October 31, 2012, 02:20:31 PM
Cool, Thanks
Title: Re: Custom Action Mod
Post by: tMicky on November 02, 2012, 12:23:40 PM
Quote from: bigjoe11a on October 31, 2012, 04:11:34 AM
Quote from: tMicky on October 12, 2012, 02:40:16 PM
Hello,

Is there a way to know the number of views a page with Custom Action Mod has?

thanks

Micky, If this is what you want to do. I would just go all the way, Using PHP code. in your source. You could keep track of every one that runs the action.

So create a new table. and add these fields

id => (int)(11)  //Record id
u_id => (int)(11) //Users ID
u_name => (string)(50) //Users Name
u_views => (int)(11) // Count the number of time this user ran this action
u_date  => (int)(25) // Update the date and time the user ran the action

Then every time the user ran this action. Update the record. If no record is fount. Then create a new record.

Then create a new sub action, and call it sa=actionAdmin and this is where you could see the results of who entered the action and now many times the users ran the action.

thanks for replying, but where and how do I do this?
Title: Re: Custom Action Mod
Post by: majk-aus on December 12, 2012, 02:31:58 PM
Hello i installed the plugin and it works great but my question is , HOW CAN I PUT NOW THE BBCode so when i write [warning]{TEXT}[/warning] It gonna come with the design in topic

Soo now this is the new Options that is displayed to me Admin Panel.



And i want to add this code BBC:

In usage add:

[warning]{TEXT}[/warning]

In HTML add:
<table width="90%" style="border-top: 1px dotted #a3a3a3; border-bottom: 1px dotted #a3a3a3; border-right: 1px dotted #a3a3a3; border-left: 3px dotted #b9b9b9; font-family: arial, sans-serif; font-size: 12px;">
   <tr style="background: #bd0100;">
       <th align="left" style="border-bottom: 1px dotted #a3a3a3; background: #bd0100; color: #FFF; padding-left: 2px;"><em>KUJDES</em></th>
    </tr>
    <tr>
       <td style="background: #fef2f4; padding-left: 20px;">{TEXT}</td>
    </tr>
</table>
Title: Re: Custom Action Mod
Post by: Shambles on December 12, 2012, 03:36:29 PM
I've read, and digested, 580 posts in 30 pages for this splendid mod.

And yet, just to prove that I'm the world's worst "user", I cannot get it out of my head that there's something simple I'm missing with it.

I thought that creating a custom action with an enabled button, would put that button on the menu. Yep, it sure does :)

I also thought that creating sub-actions subservient to that custom action would give that button a menu of its own when clicked.  Nope, it doesn't :(

And that's where I seem to be missing the point, or have I mis-installed this on my 2.0.2 installation?

Are these sub-actions really only accessible via URL (action=xx;sa=yy) or should they indeed appear within the new menu button?

I'm off for a tab...
Title: Re: Custom Action Mod
Post by: Shambles on January 24, 2013, 09:15:18 AM
A tedious bump, now I've finished my tab...


Quote from: Shambles on December 12, 2012, 03:36:29 PM
Are these sub-actions really only accessible via URL (action=xx;sa=yy) or should they indeed appear within the new menu button?

I'm off for a tab...
Title: Re: Custom Action Mod
Post by: andershz on January 28, 2013, 04:27:23 AM
If you have made any mistake with the installation then I have made the same one.
But I don't think a button menu for sub-actions is implemented.
Title: Re: Custom Action Mod
Post by: Shambles on January 28, 2013, 04:50:05 AM
Quote
If you have made any mistake with the installation then I have made the same one.
I've made no mistakes with the installation.

Quote
But I don't think a button menu for sub-actions is implemented.
That's the question I've been asking. Unless I've missed something, I can't see how a subaction would be useful, other than via a URL accessible via some method other than a button 'dropdown'.

Shame, as the mod author is active on sm.org but chooses not to get involved here  :-\
Title: Re: Custom Action Mod
Post by: johnpaul2k2 on March 04, 2013, 02:21:08 PM
thanks but how will i know what to add??
please give me examples of things to add on either bbc or html?

does this work like css

thanks
Title: Re: Custom Action Mod
Post by: Dhayzon on April 15, 2013, 05:32:13 PM
fail...............................help please



problem solved
http://www.simplemachines.org/community/index.php?topic=86793.msg3230017#msg3230017
Title: Re: Custom Action Mod
Post by: LilRyan on April 22, 2013, 05:02:53 AM
Anyone know if it's possible to use this mod to make a button (similar to reply/quick reply etc...), to accept/decline applications (a clans forums) and move the member to a user group?
Title: Re: Custom Action Mod
Post by: Mick. on July 09, 2013, 03:51:57 PM
Dang, I've been using this mod since forever and just realized when guests see these custom action pages, it shows "unknown action" in who's online.

I guess I'll try to figure out how to fix this so it shows the page name instead.
Title: Re: Custom Action Mod
Post by: Chalky on August 15, 2013, 07:16:59 PM
Hello again  ;)

The Action Name is used to identify the action from the list of actions created.
The Action URL is where you get to choose the URL of your new page, so if you put privacy in that field, the new page will be found at yoursite.com/index.php?action=privacy, for example.

The HTML Body is where you create your page.  Try some of the html you have already prepared for your page maybe, but without the <html> tags.  You may need to play with it to make it appear as you want.

As for the HTML Headers, we'll need someone who knows more than I to explain that one - I just left it blank  :P
Title: Re: Custom Action Mod
Post by: andershz on October 20, 2013, 01:11:19 PM
I have made a few enhancements to this mod for my own use.
I has occurred to me that perhaps someone else might benefit from this.
Before packaging everything up properly and conferring with the mod author about the best way forward I want to check if there is any interest among the mod users, otherwise it's just unnecessary work.

Bug fixes
New features
Refactoring
New bugs
Title: Re: Custom Action Mod
Post by: Gluz on October 25, 2013, 05:20:36 PM
Quote from: andershz on October 20, 2013, 01:11:19 PM
  • Including a </textarea> tag in block would mess up the editor.
How do you solve this?

I have a custom Form that uses some Textareas and cant get this to work properly.
Title: Re: Custom Action Mod
Post by: andershz on October 26, 2013, 05:26:01 AM
It's mentioned a couple of pages back in this thread.
http://www.simplemachines.org/community/index.php?topic=86793.msg3230017#msg3230017
Title: Re: Custom Action Mod
Post by: [yub] Lazo on February 18, 2014, 11:28:04 AM
Is it just me or when I want to change the name of the action I alredy made before the name of the action stays the same in the subs?
Title: Re: Custom Action Mod
Post by: vasilios on May 02, 2014, 04:43:13 AM
Hello!
It is possible and how the button of a custom action put near Home button and not last of menu..
Title: Re: Custom Action Mod
Post by: vasilios on May 03, 2014, 11:17:36 AM
bump
Title: Re: Custom Action Mod
Post by: vasilios on May 04, 2014, 08:04:09 AM
Ok I found the solution :D
Title: Re: Custom Action Mod
Post by: asyaavrupa on October 01, 2014, 04:58:37 AM
hi i want to use in post
Title: Re: Custom Action Mod
Post by: Gwenwyfar on December 19, 2014, 12:47:29 AM
Nice mod! :D

Quote from: tylerabell on May 16, 2008, 01:12:26 AM
when i make a php page then go to the page i get the following error...
Parse error: syntax error, unexpected $end in /home/sites/forgeguide.com/public_html/Sources/Load.php(1747) : eval()'d code(9) : eval()'d code on line 1
I have the exact same issue... On a fresh install of 2.0.8. The action just has "test" written in it. If I change it to html it works ok.

Different line though:

Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\forum\Sources\Load.php(2165) : eval()'d code(20) : eval()'d code on line 1

Edit: Ah, simple matter. Way too simple of a test. Just some random echo works :)

And as a suggestion, it would be nice if you could choose which theme would show the action with by default, like you'd do on a board.
Title: Re: Custom Action Mod
Post by: Shambles on February 12, 2015, 10:52:26 AM
This mod requires/creates rows in {smf}permissions, named "ca_1" "ca_2" etc.

While diagnosing why my members occasionally lose 'allow' permissions to their Custom Actions I spotted that these rows are being deleted whenever anything is changed within their overall membergroup permissions.

EG, I give my Global Mods permission to use Custom Action 1. Later I go to their membergroup and change their Gallery permission. Upon saving that, their Custom Action permission row (ca_1) has been deleted, meaning they no longer have the permission to use Custom Action 1.

Easy resolution is to revisit the Custom Action feature within Admin > Configuration > Features & Options > Custom Actions and reset it there, though it would be neat if the permissions rows weren't deleted to start with :(

Title: Re: Custom Action Mod
Post by: Sakae on March 04, 2015, 03:20:07 PM
Quote from: andershz on October 20, 2013, 01:11:19 PM
I have made a few enhancements to this mod for my own use.
I has occurred to me that perhaps someone else might benefit from this.
Before packaging everything up properly and conferring with the mod author about the best way forward I want to check if there is any interest among the mod users, otherwise it's just unnecessary work.

Well, I'm interested.

Since it's a old post, I'm messaging you.
Title: Re: Custom Action Mod
Post by: Livaco on June 16, 2015, 02:28:07 PM
Quick question, how do i create a sub-action?
Title: Re: Custom Action Mod
Post by: andershz on June 17, 2015, 02:35:58 AM
This is a well hidden feature.
In the table of actions there is a column named Sub-Actions, indicating the number of sub actions (contains zero if there are none).
Click on that number to get to a page where sub actions can be added/modified/deleted.
Title: Re: Custom Action Mod
Post by: Livaco on June 17, 2015, 07:31:15 AM
Thanks!
Title: Re: Custom Action Mod
Post by: mt on July 16, 2015, 02:51:04 PM
If installed under mariadb, the db installer with fail with an error msg for every " 'default' => '', " entry in the file install.php.

Removing that entries will make it work agian.
Title: Re: Custom Action Mod
Post by: skb on January 13, 2017, 03:45:10 AM
I tried creating custom action to update smf_members table. I want to change IP address and used this code
UPDATE  `db_name`.`smf_members` SET  `member_ip` =  'xxx.xxx.xx.xxx',
`member_ip2` =  'yyy.yyy.yy.yyy' WHERE  `smf_members`.`id_member` =n;


Could not accomplish. Should I be doing something differently ? 
Title: Re: Custom Action Mod
Post by: Arantor on January 13, 2017, 04:25:36 AM
Um, what were you trying to achieve exactly?
Title: Re: Custom Action Mod
Post by: skb on January 13, 2017, 04:50:48 AM
Like I said, UPDATE the smf_members table to change IP for one user.
Title: Re: Custom Action Mod
Post by: Arantor on January 13, 2017, 05:28:50 AM
Um, why? And what does that have to do with this mod?
Title: Re: Custom Action Mod
Post by: skb on January 13, 2017, 05:32:59 AM
What I'm trying to do is execute this action with a button click, rather than going into phpMyAdmin and doing it manually every time.
Title: Re: Custom Action Mod
Post by: Arantor on January 13, 2017, 05:36:21 AM
For something that SMF will rewrite anyway for users (almost) every time they hit a page?
Title: Re: Custom Action Mod
Post by: thepitster on August 02, 2017, 04:12:55 PM
when attempting to install this I got, basically AFTER I clicked install this poped up:
Code (Error) Select
BLOB, TEXT, GEOMETRY or JSON column 'name' can't have a default value
File: /Packages/temp/install.php
Line: 123


and this is the line that is causing the problem

Code (install.php Line 123) Select
$smcFunc['db_create_table']('{db_prefix}custom_actions', $columns, $indexes, array(), 'update_remove');
Title: Re: Custom Action Mod
Post by: StarredSkies on June 09, 2019, 05:06:01 PM
Quote from: Shambles on December 12, 2012, 03:36:29 PM
Are these sub-actions really only accessible via URL (action=xx;sa=yy) or should they indeed appear within the new menu button?

I'm off for a tab...

Going to re-ask this question. My subaccounts do not appear as a drop-down menu like my admin/moderator/member buttons.
Title: Re: Custom Action Mod
Post by: Pyrhel on October 18, 2019, 10:25:32 AM
Hello,
Is there a way to include theme's default bars and colors to the "page" under the action if BBC is selected?
For example to look as "index.php?action=help".
Title: Re: Custom Action Mod
Post by: Diego Andrés on October 18, 2019, 02:43:55 PM
Quote from: Pyrhel on October 18, 2019, 10:25:32 AM
Hello,
Is there a way to include theme's default bars and colors to the "page" under the action if BBC is selected?
For example to look as "index.php?action=help".

Not sure I follow, can you attach a picture of this "issue"?
Title: Re: Custom Action Mod
Post by: Pyrhel on October 19, 2019, 01:39:16 AM
If the help action is opened, it looks like this:
(https://postimg.cc/kDxvyG5v)

But if the custom action is opened, it doesn't have the theme's look and is displayed like this:
(https://postimg.cc/2LFdjctK)

Is it possible themes' style to be included in the custom page to keep the look and feel of the theme. I saw similar thing in one of the portals (I think it was "tiny portal") in which the style can be selected - to use theme's colors, borders, etc or not to.
Title: Re: Custom Action Mod
Post by: Arantor on October 19, 2019, 02:35:08 AM
It doesn't do anything because it's designed as a base for you to have complete control over what that custom action does, up to and including putting literally whatever content you want there - adding what you're asking for actually runs counter to what it was designed for.

Going with something like TP might be a simpler and better option.
Title: Re: Custom Action Mod
Post by: UserMcUsername on November 04, 2020, 12:50:04 PM
I am using custom actions mode to make CMS-like webpages that render within the forum's theme. I am currently using the HTML feature so that I can insert a page-specific stylesheet into the head that I do not want included on the forum's main page. However I really would prefer to use the PHP option so I can include to an external file, saving me from having to edit the code in the custom actions panel. However, the PHP option does not have the ability to put code in the head (instead replacing that with the Source File Code). Any hacks or tips to kinda get the best of both worlds? Ideally the top box allowing a link to a stylesheet while the bottom box allows the insertion of a php include. I know I could use an iframe on the html side but I hate iframes.
Title: Re: Custom Action Mod
Post by: nemwar on March 17, 2022, 06:58:00 AM
Quote from: thepitster on August 02, 2017, 04:12:55 PMwhen attempting to install this I got, basically AFTER I clicked install this poped up:
Code (Error) Select
BLOB, TEXT, GEOMETRY or JSON column 'name' can't have a default value
File: /Packages/temp/install.php
Line: 123

and this is the line that is causing the problem

Code ("install.php Line 123") Select
$smcFunc['db_create_table']('{db_prefix}custom_actions', $columns, $indexes, array(), 'update_remove');

Hi Guys,

i have the exact same problem.
Tested with SMF2.0.19 and 2.1.1 also with PHP7.2 and PHP7.4.

Any solution/workaround for this issue?

Best regards
NemWar