Exilis
Optimistic & Creative
Global Moderator
 
Offline
Posts: 929
 Badges: (View All)
|
 |
« on: December 27, 2008, 11:43:36 pm » |
|
Made by SyntaxBlitz, please do NOT remove credit. Used Agent Moose's Request Board code as a reference, so credit goes to him too. Some of the tricky code snippets I used from that code =] Also, thanks to Moosey for helping me out with the finding out of the username =] I wrote most of this from scratch, only small parts are from moosey's code :) Basically it creates a tab which is for requesting a feature. The feature request is sent through PM to any user of your choice. Want it customized? Post in this thread and I'll see what I can do. Also if Moosey wants to customize it (or anyone else for that matter) go ahead and do so :) To make the code work, create a custom tab with the URL /index.php?action=pm;sa=send;u= 1;other=requestFeature Change the red number to the user ID of the user who will be sent the requests. <script> /* Made by SyntaxBlitz, please do NOT remove credit. Used Agent Moose's Request Board code as a reference, do credit goes to him too. Some of the tricky code snippets I used from that code =] Also, thanks to Moosey for helping me out with the finding out of the username =] */
//The user's username? --- This code snippet is by Agent Moose, all credit goes to him. var name = document.getElementsByTagName("span"); for(v=0;v<name.length;v++){ if(name[v].innerHTML.match(/Hello <b>(.*)<\/b>/i)){ var username = RegExp.$1; } } //------------------------
if(location.href.match("action=pm") && location.href.match("other=requestFeature")) { if(username) { $("#bodyarea").after("<span class='smalltext'>Feature Request made by SyntaxBlitz of <a href='http://www.revolutionx.smfforfree3.com/'>Revolution X.</a></span>") document.title = "Request a feature" form = "<div id='requestForm'><br /><center>This is the feature request form.<br /><br />Main idea:<input type='text' name='idea' /><br />Details:<br /><text" + "area name='details' cols='50' rows='20' /></text" + "area><br /><br /><input type='submit' value='Request Feature' onClick='isItGood();' /></center></div>"; $("#bodyarea").after(form); $("input[name=subject]").val("A new feature has been requested by " + username); $("#bodyarea").hide(); } } function isItGood() { $("div#requestForm").after("<center><div id='isrite' style='overflow: auto; width: 500px; height: 500px;'><center>Is this right?<br />Main idea: " + $("input[name=idea]").val() + "<br /><br />Details: " + $("textarea[name=details]").val() + "<br /><br /><button onClick='request();'>Yes</button> <button onClick='undo();'>No</button></center></div></center>"); $("div#requestForm").hide(); } function undo() { $("div#isrite").hide(); $("div#requestForm").show(); } function request() { $("textarea[name=message]").val("Main idea: " + $("input[name=idea]").val() + "\nDetails: " + $("textarea[name=details]").val()); document.forms["postmodify"].submit(); } </script>
You'll need to register. Currently, it isn't working perfectly, because when users with few posts submit it, a captcha image comes up, and it shows the original PM body. I am working on a fix. Finally, finished XD
|
|
« Last Edit: March 14, 2009, 07:51:06 pm by SyntaxBlitz »
|
Report Spam
Logged
|
|
|
|
|
Agent Moose
|
 |
« Reply #1 on: December 28, 2008, 08:44:24 am » |
|
Pretty neat. I like the little preview you gave it 
|
|
|
|
|
Exilis
Optimistic & Creative
Global Moderator
 
Offline
Posts: 929
 Badges: (View All)
|
 |
« Reply #2 on: December 28, 2008, 10:17:52 am » |
|
I mostly did that so it'd be less like copying off of you, I didn't want to use a confirm() dialog...
|
|
|
|
Lawrence
Starter
 
Offline
Gender: 
Posts: 14
Busy, busy, busy...
 Badges: (View All)
|
 |
« Reply #3 on: January 02, 2009, 05:55:33 pm » |
|
Nice code, can you make it none centralized though? Or how would I do that?
|
|
|
|
Exilis
Optimistic & Creative
Global Moderator
 
Offline
Posts: 929
 Badges: (View All)
|
 |
« Reply #4 on: January 03, 2009, 10:40:55 am » |
|
If you don't want it centered, do this: <script> /* Made by SyntaxBlitz, please do NOT remove credit. Used Agent Moose's Request Board code as a reference, do credit goes to him too. Some of the tricky code snippets I used from that code =] Also, thanks to Moosey for helping me out with the finding out of the username =] */
//The user's username? --- This code snippet is by Agent Moose, all credit goes to him. var name = document.getElementsByTagName("span"); for(v=0;v<name.length;v++){ if(name[v].innerHTML.match(/Hello <b>(.*)<\/b>/i)){ var username = RegExp.$1; } } //------------------------
if(location.href.match("action=pm") && location.href.match("other=requestFeature")) { if(username) { $("#bodyarea").after("<span class='smalltext'>Feature Request made by SyntaxBlitz of <a href='http://www.revolutionx.smfforfree3.com/'>Revolution X.</a></span>") document.title = "Request a feature" form = "<div id='requestForm'><br />This is the feature request form.<br /><br />Main idea:<input type='text' name='idea' /><br />Details:<br /><text" + "area name='details' cols='50' rows='20' /></text" + "area><br /><br /><input type='submit' value='Request Feature' onClick='isItGood();' /></div>"; $("#bodyarea").after(form); $("input[name=subject]").val("A new feature has been requested by " + username); $("#bodyarea").hide(); } } function isItGood() { $("div#requestForm").after("<div id='isrite' style='overflow: auto; width: 500px; height: 500px;'>Is this right?<br />Main idea: " + $("input[name=idea]").val() + "<br /><br />Details: " + $("textarea[name=details]").val() + "<br /><br /><button onClick='request();'>Yes</button> <button onClick='undo();'>No</button></div>"); $("div#requestForm").hide(); } function undo() { $("div#isrite").hide(); $("div#requestForm").show(); } function request() { $("textarea[name=message]").val("Main idea: " + $("input[name=idea]").val() + "\nDetails: " + $("textarea[name=details]").val()); document.forms["postmodify"].submit(); } </script>
|
|
|
|
Mojobojo82
MVP
 
Offline
Gender: 
Posts: 838
 Badges: (View All)
|
 |
« Reply #5 on: June 14, 2009, 02:22:41 am » |
|
Thanks for this code. It's great. And i'm using the non centered one 
|
|
|
|
Andrew
|
 |
« Reply #6 on: October 22, 2009, 08:18:40 pm » |
|
Hey Exilis you think you could modify this one a little to be Request an Item for Slayer's Shop?
|
|
|
|
Exilis
Optimistic & Creative
Global Moderator
 
Offline
Posts: 929
 Badges: (View All)
|
 |
« Reply #7 on: October 23, 2009, 05:51:55 am » |
|
I could try, but I don't know much about the page slayer's shop creates...
|
|
|
|
Andrew
|
 |
« Reply #8 on: October 23, 2009, 07:57:06 am » |
|
This would be a separate page, it wouldn't actually be part of the shop. I was thinking it was something that could just be added in the webpage for the Shop, so other people could click there and request whatever item. This would include: - Item Name
- Item Price
- Item Description
^ Big text area for this one, like in the code already [/list]
|
|
|
|
Exilis
Optimistic & Creative
Global Moderator
 
Offline
Posts: 929
 Badges: (View All)
|
 |
« Reply #9 on: October 23, 2009, 02:07:56 pm » |
|
I'll attempt this. Hope it goes well! 
|
|
|
|
xboi209
|
 |
« Reply #10 on: October 23, 2009, 07:10:18 pm » |
|
hey i wanted to know how you fixed the captcha part, i think i already know how to do it but i wanna see how you did it.
|
|
|
|
Exilis
Optimistic & Creative
Global Moderator
 
Offline
Posts: 929
 Badges: (View All)
|
 |
« Reply #11 on: October 24, 2009, 05:33:05 am » |
|
The only way I can think of removing the captcha is doing it in the admin CP. Tbh, I don't like the captcha anyway so that's what I would end up doing.
|
|
|
|
xboi209
|
 |
« Reply #12 on: October 26, 2009, 07:35:31 pm » |
|
what i thought was just using this <img src="http://x.smfforfree.com/index.php?action=verificationcode;rand=78737899dbf268988283e884e525e997" alt="Please enter the code in the image above to send this pm." /><br /> <a href="http://x.smfforfree.com/index.php?action=verificationcode;rand=78737899dbf268988283e884e525e997;sound" onclick="return reqWin(this.href, 400, 120);">Listen to the Letters</a><br /><br />
<input type="text" name="visual_verification_code" size="30" tabindex="4" /> <div class="smalltext">Please enter the code in the image above to send this pm.</div>
lol(just put it like on top of the pm box part)(i think)
|
|
|
|
Exilis
Optimistic & Creative
Global Moderator
 
Offline
Posts: 929
 Badges: (View All)
|
 |
« Reply #13 on: October 27, 2009, 06:06:03 am » |
|
I tried doing that... but it didn't work  EDIT: Also, you'd need to move the captcha, not create a new one or it wouldn't work.
|
|
|
|
Agent Moose
|
 |
« Reply #14 on: October 28, 2009, 07:30:25 am » |
|
(insert code here for captcha) Yea...I would of created a code that got the HTML of the captcha, but I am to lazy to put captcha onto one of my boards... 
|
|
|
|
|
|