Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
Prev Previous Post   Next Post Next
  #1  
Old 12-22-2002, 12:29 AM
ciqala ciqala is offline
 
Join Date: Nov 2002
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default add an admin only javascript field in posts

I have a dvd forum and when i create a post about a release i include a cover picture and a link to amazon.com

I now want to use the "buy it from amazon" buttons which creates an amazon style image and when its clicked you can add to your amazon cart instantly and carry on looking at the forum or go to checkout.

the problem is they give you a piece of javascript to insert and I understand putting the ability to post executable javascript in a post is a big big security no no.

the only apparent solution would be to add a new field to the page where you create your post which only appears for admins

you can then post the code into the fiels and have it appear in the top of the postbit or wherever you want.

it would need to be database driven so that it could store the code but my programming knowledge sadly only includes if...endif and include() when it comes to php. plus i'm not sure if it would be better to create a new table to store the info or if you should add it to the end of one of the other tables...

anyways i think this is a hack that would be very useful for a multitude of reasons not limited only to amazon buttons it would allow the admins to use any <script> code they wanted without fear of the users being able to do the same.

here is an example of the code i need to include...
Quote:
<script language="JavaScript">
function popUp(URL,NAME) {
amznwin=window.open(URL,NAME,'location=yes,scrollb ars=yes,status=yes,toolbar=yes,resizable=yes,width =380,height=450,screenX=10,screenY=10,top=10,left= 10');
amznwin.focus();}
document.open();
document.write("<a href=javascriptopUp('http://buybox.amazon.com/exec/obidos/redirect?tag=hiphopdvds-20&link_code=xsc&creative=23424&camp=2025&path=/dt/assoc/tg/aa/xml/assoc/-/B00005JKCH/hiphopdvds-20/ref=ac_bb5_,_amazon')><img src=http://rcm-images.amazon.com/images/G/01/associates/remote-buy-box/buy5.gif border=0 alt='Buy from Amazon.com' ></a>");
document.close();
</script>
<noscript>
<form method="POST" action="http://buybox.amazon.com/o/dt/assoc/handle-buy-box=B00005JKCH">
<input type="hidden" name="asin.B00005JKCH" value="1">
<input type="hidden" name="tag-value" value="hiphopdvds-20">
<input type="hidden" name="tag_value" value="hiphopdvds-20">
<input type="image" name="submit.add-to-cart" value="Buy from Amazon.com" border="0" alt="Buy from Amazon.com" src="http://rcm-images.amazon.com/images/G/01/associates/add-to-cart.gif">
</form>
</noscript>
if someone can do this or provide me with a similiar hack that i could use for guidance it would be very much appreciated.

Cheers

Ciq
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:18 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01883 seconds
  • Memory Usage 2,347KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete