News:

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

Main Menu

Custom Action Mod

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

Previous topic - Next topic

winrules

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 :)


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


Kettu

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
Main Forum: SMF 2.0.6
Co-Forum: SMF 2.0.6

Techdomain

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?

mfKG

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?)

SRY my SiG is AtM AFK

winrules

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.


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


Techdomain

http://www.techdomain.com.au/index.php?action=staff

That one is a php, which I tested as an article Here

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 :)

winrules

Uhhh can you send me your index.php?


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


Techdomain

 :o

This site continues to suprise... no attachments?

anyway, here is a link:

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


winrules

Try replacing it with the attached file.

Only charter members and team members can attach files.


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


Techdomain

Nice :) if you dont mind me asking - what did you do to it?

oh - it makes sense about the attachments also.

Thanks again  :)

winrules

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.


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


Techdomain

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!

PhatTyres

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
OTB and Runnin Down The Hill

SMF 1.0.5  MKp1.0                                Clip'd In Cycling Community

Pedja

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.


winrules

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.


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


JunFan

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, 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...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?

winrules

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;


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


JunFan

#117
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!

RebelRose

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


winrules

That's an error in the code you put in for the page. If you post the code I might be able to help.


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


Advertisement: