March 28, 2024, 06:47:36 pm
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to Revolution X, where Coding meets Graphics.
 
  Home Help Search Arcade Affiliates Staff List Calendar Members Login Register  

Request a Feature

Pages: [1]   Go Down
  Print  
Author Topic: Request a Feature  (Read 2041 times)
0 Members and 1 Guest are viewing this topic.
Exilis
Optimistic & Creative
Global Moderator
Global Moderator
Offline Offline

Posts: 929


View Profile
Badges: (View All)
Tenth year Anniversary Linux User Combination
« 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.
Code:
<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

Global Mod, (sort of) at your service.

http://twitter.com/timothyaveni

Share on Facebook Share on Twitter

Agent Moose
Administrator
Adminitrator
Offline Offline

Gender: Male
Posts: 1,470



View Profile WWW
Badges: (View All)
Tenth year Anniversary Nineth year Anniversary Search
« Reply #1 on: December 28, 2008, 08:44:24 am »

Pretty neat.  I like the little preview you gave it Smiley
Report Spam   Logged


Exilis
Optimistic & Creative
Global Moderator
Global Moderator
Offline Offline

Posts: 929


View Profile
Badges: (View All)
Tenth year Anniversary Linux User Combination
« 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...
Report Spam   Logged

Global Mod, (sort of) at your service.

http://twitter.com/timothyaveni

Lawrence
Starter
Starter
Offline Offline

Gender: Male
Posts: 14


Busy, busy, busy...


View Profile
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?
Report Spam   Logged

Exilis
Optimistic & Creative
Global Moderator
Global Moderator
Offline Offline

Posts: 929


View Profile
Badges: (View All)
Tenth year Anniversary Linux User Combination
« Reply #4 on: January 03, 2009, 10:40:55 am »

If you don't want it centered, do this:
Code:
<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>
Report Spam   Logged

Global Mod, (sort of) at your service.

http://twitter.com/timothyaveni

Mojobojo82
MVP
MVP
Offline Offline

Gender: Male
Posts: 838


View Profile
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 Afro
Report Spam   Logged






Andrew
Exclusive
Exclusive
Offline Offline

Gender: Male
Posts: 539



View Profile WWW
Badges: (View All)
Combination Topic Starter Poll Voter
« 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?
Report Spam   Logged

Exilis
Optimistic & Creative
Global Moderator
Global Moderator
Offline Offline

Posts: 929


View Profile
Badges: (View All)
Tenth year Anniversary Linux User Combination
« 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...
Report Spam   Logged

Global Mod, (sort of) at your service.

http://twitter.com/timothyaveni

Andrew
Exclusive
Exclusive
Offline Offline

Gender: Male
Posts: 539



View Profile WWW
Badges: (View All)
Combination Topic Starter Poll Voter
« 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]
Report Spam   Logged

Exilis
Optimistic & Creative
Global Moderator
Global Moderator
Offline Offline

Posts: 929


View Profile
Badges: (View All)
Tenth year Anniversary Linux User Combination
« Reply #9 on: October 23, 2009, 02:07:56 pm »

I'll attempt this. Hope it goes well! Tongue
Report Spam   Logged

Global Mod, (sort of) at your service.

http://twitter.com/timothyaveni

xboi209
Exclusive
Exclusive
Offline Offline

Gender: Male
Posts: 235


View Profile WWW
Badges: (View All)
Apple User Mobile User
« 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.
Report Spam   Logged
Exilis
Optimistic & Creative
Global Moderator
Global Moderator
Offline Offline

Posts: 929


View Profile
Badges: (View All)
Tenth year Anniversary Linux User Combination
« 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.
Report Spam   Logged

Global Mod, (sort of) at your service.

http://twitter.com/timothyaveni

xboi209
Exclusive
Exclusive
Offline Offline

Gender: Male
Posts: 235


View Profile WWW
Badges: (View All)
Apple User Mobile User
« Reply #12 on: October 26, 2009, 07:35:31 pm »

what i thought was just using this
Code:
<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)
Report Spam   Logged
Exilis
Optimistic & Creative
Global Moderator
Global Moderator
Offline Offline

Posts: 929


View Profile
Badges: (View All)
Tenth year Anniversary Linux User Combination
« Reply #13 on: October 27, 2009, 06:06:03 am »

I tried doing that... but it didn't work Sad

EDIT: Also, you'd need to move the captcha, not create a new one or it wouldn't work.
Report Spam   Logged

Global Mod, (sort of) at your service.

http://twitter.com/timothyaveni

Agent Moose
Administrator
Adminitrator
Offline Offline

Gender: Male
Posts: 1,470



View Profile WWW
Badges: (View All)
Tenth year Anniversary Nineth year Anniversary Search
« 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... Tongue
Report Spam   Logged


Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy