You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 333 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - A long shot request [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
gunner
Sergeant
Sergeant


Joined: Jul 07, 2003
Posts: 140


PostPosted: Thu Aug 21, 2003 3:52 pm Reply with quoteBack to top

Howdy folks. I have a request.... I run a website that uses the forums to rate beers according to a predefined template:
Quote:
Score

/6 First impression. <place comments here>

/6 Speed rating. <place comments here>

/6 Intangible. <place comments here>

/6 Overall taste quality. <place comments here>

/24 Total

Intoxication Level /6 <place comments here>

Optional Comments <place comments here>


I was hoping there would be away to substitute the "list" tag (it is not used very frequently on my site) so that when it is selected the above template text is inserted into the body of the post?

My second born to the person that helps....cheers

_________________
.::.
http://www.boozebros.ca
Find all posts by gunnerView user's profileSend private messageVisit poster's website
Hadron
Corporal
Corporal


Joined: Aug 20, 2003
Posts: 61


PostPosted: Mon Aug 25, 2003 2:36 pm Reply with quoteBack to top

I have two kids, so you can keep yours. Wink I'll take a stab at this one. You wont even have to remove your wonderful List functionality. Open up posting_body.tpl in your theme for the forum.

First scroll down a couple hundred lines till you see stuff like:
Code:

<input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" />


Now add a new one in:
Code:

<input type="button" class="button" accesskey="z" name="addbbcode99" value="BEER" style="text-decoration: underline; width: 40px" onClick="bbstyle(99)" onMouseOver="helpline('z')" />


You may need to tweak the html to make the button appear nicely by putting the above in a table cell (<td>) or somesuch. I'll leave that to you.

Now we need to scroll up till you find:
Code:

// Helpline messages
b_help = "{L_BBCODE_B_HELP}";


Add in your beer review help text:
Code:

z_help = "Insert Beer Review Template";


Now what you have really isn't a tag, so we'll have to handle your button specifically...So scroll down till you find:

Code:
function bbstyle(bbnumber) {


After that line insert:
Code:

if (bbnumber == 99) {
document.post.message.value += '/X First impression. <place comments here>\n/X Speed rating. <place comments here>\n/X Intangible. <place comments here>\n/X Overall taste quality. <place comments here>\n/X Total\n\nIntoxication Level /6 <place comments here>\nOptional Comments <place comments here>';
}else {


Scroll down to the bottom of that bbstyle function till you see:
Code:

storeCaret(document.post.message);
}


And insert a brace between the storeCaret function and the brace:
Code:

storeCaret(document.post.message);
}
}


Done. Save, upload, enjoy.

--Hadron
Find all posts by HadronView user's profileSend private message
gunner
Sergeant
Sergeant


Joined: Jul 07, 2003
Posts: 140


PostPosted: Mon Aug 25, 2003 4:34 pm Reply with quoteBack to top

I'm gonna try it right now....Smile I hope it works. Stay tuned...

_________________
.::.
http://www.boozebros.ca
Find all posts by gunnerView user's profileSend private messageVisit poster's website
gunner
Sergeant
Sergeant


Joined: Jul 07, 2003
Posts: 140


PostPosted: Mon Aug 25, 2003 5:37 pm Reply with quoteBack to top

Awesome...it almost worked perfectly. This is what was inserted into the body of the message

Quote:
/X First impression. <place comments here>
/X Speed rating. <place comments here>
/X Intangible. <place comments here>
/X Overall taste quality. <place comments here>
/X Total

Intoxication Level /6 <place comments here>
Optional Comments <place comments here>


The /x was extra. I assume I can just edit this out. I'm using the ncbundle and this line wasn't there
Code:
storeCaret(document.post.message);
}
Instead this line was present
Code:
storeCaret(txtarea);
}
so I just added the brace there (it worked).

I'm very happy about this. I also had trouble getting the button to appear in the right spot, but I think I'll be able to figger it out Smile

_________________
.::.
http://www.boozebros.ca

Last edited by gunner on Mon Aug 25, 2003 7:14 pm; edited 1 time in total
Find all posts by gunnerView user's profileSend private messageVisit poster's website
gunner
Sergeant
Sergeant


Joined: Jul 07, 2003
Posts: 140


PostPosted: Mon Aug 25, 2003 5:57 pm Reply with quoteBack to top

grrr..nevermind your suggestion was perfect the "x" that I thought was extra was obviously meant to signify the score. You smart me dumb LOL

Honestly if you can find my second born he's all yours. Believe it or not I'm studying to become neurosurgon LOL

_________________
.::.
http://www.boozebros.ca
Find all posts by gunnerView user's profileSend private messageVisit poster's website
gunner
Sergeant
Sergeant


Joined: Jul 07, 2003
Posts: 140


PostPosted: Mon Aug 25, 2003 7:13 pm Reply with quoteBack to top

At this point I think I'm just talking to myself, but everything works perfectly. Very happy Razz Razz Razz

_________________
.::.
http://www.boozebros.ca
Find all posts by gunnerView user's profileSend private messageVisit poster's website
Hadron
Corporal
Corporal


Joined: Aug 20, 2003
Posts: 61


PostPosted: Tue Aug 26, 2003 10:13 am Reply with quoteBack to top

Glad it worked for ya.. Smile Yeah the X was a score placeholder.

--Hadron
Find all posts by HadronView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.039 Seconds - 353 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::