Custom Action Mod

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

Previous topic - Next topic

buspass

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?

Enders

Is there a way to make only "registered" users view it? And how would I add "Members viewing this page" to it?

Rumbaar

In 1.1.x I don't think it's possible, in 2.x I think there are more permissions options.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Vandaahl

Will this mod work for version 2 RC1? The installer is giving me a 'test failed' error on Admin.php.

Rumbaar

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.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

herka

really looking forward to update! its an great mod!

gj m8!

Garry1953

I agree with herka, and also look forward to the RC1 update

darkelhaym

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!';

}
?>

cme1st2302

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
SMF Version: 1.1.11
SimplePortal Version: 2.3.2

Admin

He who waits for perfect conditions sees nothing!!
If you need help adding a button or tab PM me!!

Rumbaar

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.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

buspass

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

darkelhaym

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!


Garry1953

NIBOGO
Handy Hint, Thanks  :D

kingkingston


alexx_ori

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

Rumbaar

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_
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Bl4ck.bt

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

madman71

#398
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.


Rumbaar

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?
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Advertisement: