SELECT poll_name, question, width, style_js_file FROM polls, styles WHERE poll_id = #URL.id# AND polls.style_id = styles.style_id SELECT option_id, name, orderby FROM options WHERE poll_id = #URL.id# AND enabled = yes ORDER BY orderby poll_name = '#replace(poll_name, "'", "\'", "all")#'; question = '#replace(question, "'", "\'", "all")#'; num_options = #options.RecordCount#; cwg_base_url = 'http://www.coolwebgadgets.com'; cast_vote_url = cwg_base_url + '/votemagic/cast_vote.cfm' show_results_url = cwg_base_url + '/votemagic/show_results.cfm' poll_id = #URL.id#; width = #width#; options = new Array; options[#i#] = new Object; options[#i#].text = '#replace(options.name[i], "'", "\'", "all")#'; options[#i#].id = #options.option_id[i]#; function display_poll() { start_table(); show_poll_name(); show_question(); start_options(); for(i=1; i<=num_options; i++) { show_option(options[i].text, options[i].id); } end_options(); end_table(); } function start_table() { document.write("
"); } function end_table() { document.write("
"); document.write("CoolWebGadgets.com - cool free stuff for your web site
"); document.write("
"); } function show_poll_name() { document.write(""+ poll_name +"
"); } function show_question() { document.write(""+ question +"
"); } function start_options() { document.write("
"); document.write(""); } function end_options() { document.write("
"); document.write(" "); document.write("Show results"); document.write("
"); } function show_option(option, id) { document.write(" "); document.write(""+ option); document.write("
"); }