vForums Support Banner


Visit Base Classics - Gaming Chairs

 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: [F] Pop up box code help - View Topic
Topic Rating: *****
Printable View
Nick
Very Senior Member
*****

[Avatar]

Posts: 3,013
Status: Offline
Gender: Male
Location: vForums
Age: 36
Joined:  
Reputation: 62%  


pmwww
[F] Pop up box code help (28th Dec 07 at 6:02am UTC)
Code:
 
  1. <script language="JavaScript">
  2.  
  3. if(location.href.match(/action=post$/gi))
  4. {
  5. var a = window.prompt("What is your board URL?","http://");
  6.  
  7. if (a != 'http://') {
  8. if (a.indexOf('http://http://') != -1){
  9. a = 'ht'+ a.split('//ht')[1];
  10. }
  11. document.postForm.message.value+="Board URL: "+a+"nnProblem:nn";
  12. }
  13. }
  14.  
  15. </script>
  16.  
 


I made this code (Though I do not know how I did it, just followed a few steps.), it kinda works though it will not put the link into the post, and I want to put .virtualforums.co.uk in the non-url area, so you can only put your forums link, instead of putting http://Forums_link.virtualforums.co.uk.

Thanks,
Darkmage
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Pop up box code help (29th Dec 07 at 11:35pm UTC)
to do that I would suggest some form of post request form... instead of a prompt...

What you could do I guess is check if it contains .virtualforums.co.uk

and if it doesn't add it... and if it does then don't add it.

(should be in code support! {Wink} )
Nick
Very Senior Member
*****

[Avatar]

Posts: 3,013
Status: Offline
Gender: Male
Location: vForums
Age: 36
Joined:  
Reputation: 62%  


pmwww
Re: Pop up box code help (30th Dec 07 at 12:57am UTC)
I guess I can fix up Ross' Posting form, but I was thinking of having it, just like PBS form.
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Pop up box code help (30th Dec 07 at 1:00am UTC)
PBS' is a form isn't it? It isn't a prompt box..

You can use a prompt box no problem...it's just the code to do it would be stupidly long when you could just code a post modification box...

I'm happy to help ya! {Smile}
Nick
Very Senior Member
*****

[Avatar]

Posts: 3,013
Status: Offline
Gender: Male
Location: vForums
Age: 36
Joined:  
Reputation: 62%  


pmwww
Re: Pop up box code help (30th Dec 07 at 1:06am UTC)
I know PBS has a form, Awhile ago it used to be Prompt box, but all well. I guess no Biggie, thanks.
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Pop up box code help (30th Dec 07 at 1:10am UTC)
Gimme 10 mins and I'll make you a prompt box one that automatically checks if it has virtual forums in it! {Smile}
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Pop up box code help (30th Dec 07 at 1:20am UTC)
Code:
 
  1. <script>
  2. //Darkmage's Request
  3. //Created By Wrighty
  4.  
  5. function prompt_do(){
  6. var a = window.prompt("What is your board URL?","http://");
  7. url = '';
  8. if(a=="http://"||a==''){
  9. url='[i]Not Entered[/i]';
  10. }else if(!a.match(/.virtualforums.co.uk/i) && !a.match(/http:\/\//i)){
  11. url='http://'+a+'.viritualforums.co.uk';
  12. }else if(!a.match(/.virtualforums.co.uk/i)){
  13. url=a+'.viritualforums.co.uk';
  14. }
  15. document.post_form.message.value="Board URL: "+url+"\n\nProblem:\n\n";
  16. }
  17.  
  18. if(location.href.match(/\/post\//i) && !location.href.match(/\/topic\//i)){
  19. prompt_do();
  20. check_message_length();
  21. }
  22. </script>
  23.  
 


should do it! {Smile}


Even threw in a lil' special something for ya! {Smile}
Nick
Very Senior Member
*****

[Avatar]

Posts: 3,013
Status: Offline
Gender: Male
Location: vForums
Age: 36
Joined:  
Reputation: 62%  


pmwww
Re: Pop up box code help (30th Dec 07 at 1:36am UTC)
ok thanks ^_^

Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Pop up box code help (30th Dec 07 at 1:37am UTC)
No worries! {Cheesy}

(it updates the characters left automatically! {Cheesy} )
Nick
Very Senior Member
*****

[Avatar]

Posts: 3,013
Status: Offline
Gender: Male
Location: vForums
Age: 36
Joined:  
Reputation: 62%  


pmwww
Re: Pop up box code help (30th Dec 07 at 1:42am UTC)
it dont work: {Sad} Just click on new thread
http://magedesigns.virtualforums.co.uk/board/Support/

The box comes up I put in ffnation, then I click ok, and the link does not get added to the posting field.

Edit: on your forum why do you have "DarkMage's requests?" and BTW I don't capitalize my M on mage, So I keep it Darkmage.
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Pop up box code help (30th Dec 07 at 1:44am UTC)
guest can't make a post..

put it in the footer... as I'm guessing you put it in the header? {Smile}
Nick
Very Senior Member
*****

[Avatar]

Posts: 3,013
Status: Offline
Gender: Male
Location: vForums
Age: 36
Joined:  
Reputation: 62%  


pmwww
Re: Pop up box code help (30th Dec 07 at 1:46am UTC)
^_^ yes I did put it in the header. and guests should be able to post.
it works now, and I made guests enabled.
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Pop up box code help (30th Dec 07 at 1:48am UTC)
so they can! {Cheesy}
 Printable View

All times are GMT+0 :: The current time is 7:30am
Page generated in 0.316 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums