Search Results

Search found 523 results on 21 pages for 'h3'.

Page 14/21 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Wordpress - related posts by custom taxonomy problem

    - by Nordin
    Hello, I'm trying to display related posts based on a custum taxonomy. I found a query at wordpress.org that kind of works. However the original post gets duplicated in the results multiple times. (words is the name of the custom taxonomy I use) What seems to happen is that the single post gets duplicated according to what amount showpost is set. Any idea's what could cause this? The code: <?php //for in the loop, display all "content", regardless of post_type, //that have the same custom taxonomy (e.g. words) terms as the current post $backup = $post; // backup the current object $found_none = '<h2>No related posts found!</h2>'; $taxonomy = 'words';// e.g. post_tag, category, custom taxonomy $param_type = 'words'; // e.g. tag__in, category__in, but genre__in will NOT work $post_types = get_post_types( array('public' => true), 'names' ); $tax_args=array('orderby' => 'none'); $tags = wp_get_post_terms( $post->ID , $taxonomy, $tax_args); if ($tags) { foreach ($tags as $tag) { $args=array( "$param_type" => $tag->slug, 'post__not_in' => array($post->ID), 'post_type' => $post_types, 'showposts'=>5, 'caller_get_posts'=>1 ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { while ($my_query->have_posts()) : $my_query->the_post(); ?> <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3> <?php $found_none = ''; endwhile; } } } if ($found_none) { echo $found_none; } $post = $backup; // copy it back wp_reset_query(); // to use the original query again ?>

    Read the article

  • decorator pattern

    - by vbNewbie
    I have a program that converts currency using a specific design pattern. I now need to take my converted result and using the decorator pattern allow the result to be converted to 3 different formats: 1 - exponential notation, rounded to 2 decimal points. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace Converter { public partial class Form1 : Form { // Setup Chain of Responsibility Handler h1 = new USDHandler(); Handler h2 = new CADHandler(); Handler h3 = new AUDHandler(); public string reqCurName; public int reqAmt; public string results; public string requestID; public Form1() { InitializeComponent(); h1.SetSuccessor(h2); h2.SetSuccessor(h3); } // "Handler" private void button1_Click_1(object sender, EventArgs e) { reqCurName = txtInput.Text; reqAmt = Convert.ToInt32(txtAmt.Text.ToString()); results = h1.HandleRequest(reqCurName, reqAmt); if (results != "") { lblResult.Text = results; lblResult.Visible = true; } } abstract class Handler { protected Handler successor; public string retrn; public void SetSuccessor(Handler successor) { this.successor = successor; } public abstract string HandleRequest(string requestID, int reqAmt); } // "USD Handler" class USDHandler : Handler { public override string HandleRequest(string requestID, int reqAmt) { if (requestID == "USD") { retrn = "Request handled by " + this.GetType().Name + " \nConversion from Euro to USD is " + reqAmt/0.630479; return (retrn); } else if (successor != null) { retrn = successor.HandleRequest(requestID, reqAmt); } return (retrn); } } // "CAD Handler" class CADHandler : Handler { public override string HandleRequest(string requestID, int reqAmt) { if (requestID == "CAD") { retrn = "Request handled by " + this.GetType().Name + " \nConversion from Euro to CAD is " + reqAmt /0.617971; return (retrn); } else if (successor != null) { retrn = successor.HandleRequest(requestID, reqAmt); } return (retrn); } } // "AUD Handler" class AUDHandler : Handler { public override string HandleRequest(string requestID, int reqAmt) { if (requestID == "AUD") { requestID = "Request handled by " + this.GetType().Name + " \nConversion from Euro to AUD is " + reqAmt / 0.585386; return (requestID); } else if (successor != null) { retrn = successor.HandleRequest(requestID, reqAmt); } return (requestID); } } } }

    Read the article

  • set the focus on the scroller when button is clicked

    - by liz
    hi i have a script <script type="text/javascript"> window.addEvent('domready', function(){ var totIncrement = 0; var increment = 560; var maxRightIncrement = increment*(-6); var fx = new Fx.Style('slider-list', 'margin-left', { duration: 1000, transition: Fx.Transitions.Back.easeInOut, wait: true }); //------------------------------------- // EVENTS for the button "previous" $('previous').addEvents({ 'click' : function(event){ if(totIncrement<0){ totIncrement = totIncrement+increment; fx.stop() fx.start(totIncrement); } } }); //------------------------------------- // EVENTS for the button "next" $('next').addEvents({ 'click' : function(event){ if(totIncrement>maxRightIncrement){ totIncrement = totIncrement-increment; fx.stop() fx.start(totIncrement); } } }) }); </script> in mootools v1.1 it makes a scroller function at the bottom of my html page. but when i click the next button the page's focus moves to the top of the page. how do i keep it on the scroller? this is the html fragment: <h3>Our Pastas</h3> <div id="slider-buttons"> <a href="#" id="previous">Previous</a> | <a href="#" id="next">Next</a&gt; </div> <div id="slider-stage"> <ul id="slider-list"> <li class="list_item"> <div id="thumbnail"><a href="xxx/product-catalog/pasta/long-pasta-in-brown-bags/bucatini"><img src="xxx/images/stories/products/_thumb1/bucatini.gif"></a></div><h4><a href="xxx/product-catalog/pasta/long-pasta-in-brown-bags/bucatini">Rustichella d'Abruzzo Bucatini</a></h4> </li> <li class="list_item"> <div id="thumbnail"><a href="xxx/product-catalog/pasta/pasta-in-trays/calamarata"><img src="xxx/images/stories/products/_thumb1/calamarata.jpg"></a></div><h4><a href="xxx/product-catalog/pasta/pasta-in-trays/calamarata">Rustichella d'Abruzzo Calamarata</a></h4> </li> <li class="list_item"> <div id="thumbnail"><a href="xxx/product-catalog/pasta/pasta-in-trays/cannolicchi"><img src="xxx/images/stories/products/_thumb1/cannolicchi.jpg"></a></div><h4><a href="xxx/product-catalog/pasta/pasta-in-trays/cannolicchi">Rustichella d'Abruzzo Cannolicchi</a></h4> </li> </ul></div>

    Read the article

  • Associated models in Rails?

    - by dannymcc
    Hi Everyone, In my rails application I have two models called Kases and Notes. They work in the same way comments do with blog posts, I.e. each Kase entry can have multiple notes attached to it. I have got everything working, but for some reason I cannot get the destroy link to work for the Notes. I think I am overlooking something that is different with associated models to standard models. Notes Controller class NotesController < ApplicationController # POST /notes # POST /notes.xml def create @kase = Kase.find(params[:kase_id]) @note = @kase.notes.create!(params[:note]) respond_to do |format| format.html { redirect_to @kase } format.js end end end Kase Model class Kase < ActiveRecord::Base validates_presence_of :jobno has_many :notes Note Model class Note < ActiveRecord::Base belongs_to :kase end In the Kase show view I call a partial within /notes called _notes.html.erb: Kase Show View <div id="notes"> <h2>Notes</h2> <%= render :partial => @kase.notes %> <% form_for [@kase, Note.new] do |f| %> <p> <h3>Add a new note</h3> <%= f.text_field :body %><%= f.submit "Add Note" %> </p> <% end %> </div> /notes/_note.html.erb <% div_for note do %> <div id="sub-notes"> <p> <%= h(note.body) %><br /> <span style="font-size:smaller">Created <%= time_ago_in_words(note.created_at) %> ago on <%= note.created_at %></span> </p> <%= link_to "Remove Note", kase_path(@kase), :confirm => 'Are you sure?', :method => :delete, :class => 'important' %> </div> <% end %> As you can see, I have a Remove Note destroy link, but that destroys the entire Kase the note is associated with. How do I make the destroy link remove only the note? <%= link_to "Remove Note", kase_path(@kase), :confirm => 'Are you sure?', :method => :delete, :class => 'important' %> Any help would, as always, be greatly appreciated! Thanks, Danny

    Read the article

  • Are these jobs for developer or designers or for client itself?

    - by jitendra
    Spell checking grammar checking Descriptive alt text for big chart , graph images, technical images To write Table summary and caption Descriptive Link text Color Contrast checking Deciding in content what should be H2 ,H3, H4... and what should be <strong> or <span class="boldtext"> Meta Description and keywords for each pages Image compression To decide Filenames for images,PDf etc To decide Page's <title> for each page

    Read the article

  • Are these jobs for developer or designers or for client itself? for a web-site projects

    - by jitendra
    Spell checking grammar checking Descriptive alt text for big chart , graph images, technical images To write Table summary and caption Descriptive Link text Color Contrast checking Deciding in content what should be H2 ,H3, H4... and what should be <strong> or <span class="boldtext"> Meta Description and keywords for each pages Image compression To decide Filenames for images,PDf etc To decide Page's <title> for each page

    Read the article

  • Getting <divs>'s to align next to each other

    - by user1322845
    I have the following code I am trying to get working correctly: <div id="newspost_bg"> <article> <p> <header><h3>The fast red fox!</h3></header> This is where the article resides in the article tag. This is good for SEO optimization. <footer>Read More..</footer> </p> </article> </div> <div id="newspost_bg"> hello </div> <div id="newspost_bg"> hello </div> <div id="advertisement"> <script type="text/javascript"><!-- google_ad_client = "ca-pub-2139701283631933"; /* testing site */ google_ad_slot = "4831288817"; google_ad_width = 120; google_ad_height = 600; //--> </script> </div> Here is the css that goes with it: #newspost_bg{ position: relative; background-color: #d9dde1; width:700px; height:250px; margin: 10px; margin-left: 20px; border: solid 10px #1d2631; float:left; } #newspost_bg article{ position: relative; margin-left: 20px; } #advertisement{ float: left; background-color: #d9dde1; width: 125px; height: 605px; margin: 10px; } The problem I'm experiencing is that the advertisements im trying to get setup will align with the last with the id of newspost_bg but im looking to havce it align to the top of the container it is in. I dont know if this is enough info, if not please let me know what you might need. Im new to the web coding scene so any and all critiques help me.

    Read the article

  • shuffling array javascript

    - by Dennis Callanan
    <!doctype html> <html lang="en"> <head> <meta charset="utf=8" /> <title>Blackjack</title> <link rel="stylesheet" href="blackjack.css" /> <script type="text/javascript"> var H2 = 2; var S2 = 2; var D2 = 2; var C2 = 2; var H3 = 3; var S3 = 3; var D3 = 3; var C3 = 3; var deck = new Array(H2, S2, D2, C2, H3, S3, D3, C3); var new_deck = new Array(); var r; document.write("deck = ") for (r =0; r<deck.length; r++){ document.write(deck[r]); } document.write("</br>") document.write("new deck = ") for (r=0; r<new_deck.length; r++){ document.write(new_deck[r]); } document.write("</br>") for (r=0;r<deck.length;r++){ var randomindex = Math.floor(Math.random()*deck.length); new_deck.push(randomindex) deck.pop(randomindex) } document.write("deck = ") for (r =0; r<deck.length; r++){ document.write(deck[r]); } document.write("</br>") document.write("new deck = ") for (r=0; r<new_deck.length; r++){ document.write(new_deck[r]); } document.write("</br>") </script> </head> <body> </body> </html> Obviously this isn't the full Blackjack game here. It's just a test to see if shuffling the array works by printing the contents of both decks (arrays) before and after the shuffle. I'm only using 8 cards at the moment, 4 2's and 4 3's. What I am getting from this is: deck = 22223333 new deck = deck = 2222 new deck = 7502 What I'm hoping to get is: deck = 22223333 new deck = deck = new deck = 23232323 (or any of the 8 numbers, generated randomly) So it should be shuffling those 8 cards, what am I doing wrong? I'm only new to javascript but I've used some python before. I've done something similar in python and worked perfectly, but I'm not sure what's wrong here. Thanks for any answers in advance!!

    Read the article

  • How is font-size not working here?

    - by markvgti
    Following advice in The 6 Most Important CSS Techniques You Need To Know, I set my body's font-size to 62.5%, the container div's font-size to 1.4 em (slight variation from the article). p.tags and p.published's font-size is set to 1em. However, this doesn't work for me. Both the normal text and text in p.tags and p.published comes out to be the same size (16.8px as computed by Firebug). Can you explain why my code isn't working? I am testing in Firefox 3.6.3. The sample page shown by the author works just fine in the very same browser. I've reproduced the entire page below—apologies for the length of it, but I thought it better to not leave out anything. <html> <head> <title>Title</title> <style type="text/css"> body { font-family: Georgia, "Century Schoolbook", "Times New Roman", Serif; font-size: 62.5%; background-color: #2B3856; /* Dark slate blue */ } h1, h2, h3, h4, h5, h6 { font-family: Verdana, Helvetica, Tahoma, "Sans Serif"; color: #2B3856; margin-top: 2px; } h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { text-decoration: none; color: #2B3856; } h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover { text-decoration: underline; } div#container { width: 800px; font-size: 1.4em; margin: 5px auto; background-color: #E3E4FA; /* Lavender */ } #sidebar { width: 200px; float: right; margin: 0px; padding: 0px; } #sidebar div { padding: 0 5px 5px; } #sidebar div.shadowbox { margin-right: 5px; } #content { width: 600px; float: left; margin: 0px; padding: 0px; } #header { /*background-color: white;*/ background-color: #2B3856; /* #E3E4FA; Lavender */ margin-bottom: 5px; height: 100px; } #header h1 { color: #B93B8F; /* Plum */ line-height: 100px; text-align: center; font-size: 45px; } #description { color: #7D1B7E /* Dark Orchid */ } a { text-decoration: underline; color: #153E7E; } a:hover { text-decoration: none; } div#posts { padding: 0px; font-size: 1.2em; margin: 0px; } div#posts div.post { padding: 5px; margin: 0px 5px 15px 5px; } p.tags, p.published { font-size: 1em; } .shadowbox { background: repeat 0 0 url('http://www.jawsalgorhythmics.com/images/darkness-100x100-10pct.png'); } .justifycenter { text-align: center; } .floatright { float:right; } .floatleft { float: left; } .clearright { clear: right; } .clearleft { clear:left; } .clearboth { clear: both; } .halfsidebarwidth { width: 82px; } </style> </head> <body> <div id="container"> <div id="header"> <h1>Odds 'n Ends</h1> </div> <!-- header --> <div id="sidebar"> <div class="shadowbox"> <br /><p class="justifycenter"><img width="64" height="64" src="{PortraitURL-64}" /></p> <div class="floatleft halfsidebarwidth"><a href="/archive" class="archive">Archives</a></div> <div class="floatleft halfsidebarwidth"><a href="{RSS}" class="rss">RSS</a></div> <div class="clearboth"></div> </div> </div> <!-- sidebar --> <div id="content"> <div id="posts"> <div class="post shadowbox"> <span class="quote"> "It does not matter how slow you go so long as you do not stop." <div class="source">Wisdom of <a href="#" title="http://en.wikipedia.org/wiki/Confucius">Confucius</a></div> </span> <p class="tags">Tags: #<a href="#" title="http://demo.tumblr.com/tagged/wisdom">wisdom</a>&nbsp; </p> <p class="published">Posted: Nov 08, 2006 at 2:27 pm &nbsp;&nbsp;<a href="#" title="http://demo.tumblr.com/post/236/it-does-not-matter-how-slow-you-go-so-long-as-you">Permalink</a>&nbsp;&nbsp; <a href="#" title="http://tumblr.com/xr06k">Short URL</a></p> </div> </div> <!-- posts --> </div> <!-- content --> <div class="clearboth"></div> <div id="footer" style="text-align: justify;"> <h1>The footer</h1> </div> </div> <!-- container --> </body> </html>

    Read the article

  • Space in DIV ??

    - by alex
    Hello all, Is it possible to avoid the spaces X & Y (see image)? There is no padding in CSS! <html> <head> <title>Prova WIDGET</title> <link rel="stylesheet" href="jquery-ui-1.8.1.custom/css/ui-lightness/jquery-ui-1.8.1.custom.css" type="text/css"> <script src="jquery-ui-1.8.1.custom/development-bundle/jquery-1.4.2.js" type="text/javascript"></script> <script src="jquery-ui-1.8.1.custom/js/jquery-ui-1.8.1.custom.min.js" type="text/javascript"></script> <script type="text/javascript"> $(themify); function themify(){ $("#pulsante").addClass("ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all"); //ui-button-text } </script> <style>#test{display:none}</style> <script type="text/javascript"> function rendiVisibile(){ if(document.getElementById("test").style.display = "none"){ $("#test").css({"width":"100px","float":"right","text-align":"center"}); $("#test").show("slide",{},1000); } } </script> </head> <body> <h2 class="ui-widget-header">Tentativo widget con DIV</h2> <form action=""> <input type="button" value="Submit" id="pulsante" onclick="rendiVisibile()";><br/></br> <div id="test" class="ui-widget ui-widget-content ui-corner-all"> <h3 class="ui-widget-header ui-corner-all">CIAO</h3> <p class="ui-widget-content ui-corner-all">Un saluto</p> </div> </form> </body> </html>

    Read the article

  • PHP: Remove Simple Session with Get-Method

    - by elmaso
    Hello, I want to Remove the Sessions from this php code, actually if someone searches i get this url search.php?searchquery=test but if I reload the page, the results are cleaned. how can I remove the Sessions to get the Results still, if someone reloads the page? this are the codes: search.php <?php session_start(); ?> <form method="get" action="querygoogle.php"> <label for="searchquery"><span class="caption">Search this site</span> <input type="text" size="20" maxlength="255" title="Enter your keywords and click the search button" name="searchquery" /></label> <input type="submit" value="Search" /> </form> <?php if(!empty($_SESSION['googleresults'])) { echo $_SESSION['googleresults']; unset($_SESSION['googleresults']); } ?> querygoogle.php <?php session_start(); $url = 'http://www.example.com'; $handle = fopen($url, 'rb'); $body = ''; while (!feof($handle)) { $body .= fread($handle, 8192); } fclose($handle); $json = json_decode($body); foreach($json->responseData->results as $searchresult) { if($searchresult->GsearchResultClass == 'GwebSearch') { $formattedresults .= ' <div class="searchresult"> <h3><a href="' . $searchresult->unescapedUrl . '">' . $searchresult->titleNoFormatting . '</a></h3> <p class="resultdesc">' . $searchresult->content . '</p> <p class="resulturl">' . $searchresult->visibleUrl . '</p> </div>'; } } $_SESSION['googleresults'] = $formattedresults; header("Location: search.php?searchquery=" . $_GET['searchquery']); exit; ?> thank you for your help!!

    Read the article

  • whats wrong with this php mysql_real_escape_string

    - by skyhigh
    Hi Atomic Number Latin English Abbreviation * check the variables for content */ /*** a list of filters ***/ $filters = array( 'searchtext' => array( 'filter' => FILTER_CALLBACK, 'options' => 'mysql_real_escape_string'), 'fieldname' => array( 'filter' => FILTER_CALLBACK, 'options' => 'mysql_real_escape_string') ); /*** escape all POST variables ***/ $input = filter_input_array(INPUT_POST, $filters); /*** check the values are not empty ***/ if(empty($input['fieldname']) || empty($input['searchtext'])) { echo 'Invalid search'; } else { /*** mysql hostname ***/ $hostname = 'localhost'; /*** mysql username ***/ $username = 'username'; /*** mysql password ***/ $password = 'password'; /*** mysql database name ***/ $dbname = 'periodic_table'; /*** connect to the database ***/ $link = @mysql_connect($hostname, $username, $password); /*** check if the link is a valid resource ***/ if(is_resource($link)) { /*** select the database we wish to use ***/ if(mysql_select_db($dbname, $link) === TRUE) { /*** sql to SELECT information***/ $sql = sprintf("SELECT * FROM elements WHERE %s = '%s'", $input['fieldname'], $input['searchtext']); /*** echo the sql query ***/ echo '<h3>'.$sql.'</h3>'; /*** run the query ***/ $result = mysql_query($sql); /*** check if the result is a valid resource ***/ if(is_resource($result)) { /*** check if we have more than zero rows ***/ if(mysql_num_rows($result) !== 0) { echo '<table>'; while($row=mysql_fetch_array($result)) { echo '<tr> <td>'.$row['atomicnumber'].'</td> <td>'.$row['latin'].'</td> <td>'.$row['english'].'</td> <td>'.$row['abbr'].'</td> </tr>'; } echo '</table>'; } else { /*** if zero results are found.. ***/ echo 'Zero results found'; } } else { /*** if the resource is not valid ***/ 'No valid resource found'; } } /*** if we are unable to select the database show an error ****/ else { echo 'Unable to select database '.$dbname; } /*** close the connection ***/ mysql_close($link); } else { /*** if we fail to connect ***/ echo 'Unable to connect'; } } } else { echo 'Please Choose An Element'; } ? I got this code from phppro.org tutorials site and i tried to run it. It gives Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established. .... Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO).... I went to php.net and look it up "Note: A MySQL connection is required before using mysql_real_escape_string() otherwise an error of level E_WARNING is generated, and FALSE is returned. If link_identifier isn't defined, the last MySQL connection is used." My questions are: 1-why they put single quotation around mysql_real_escape_string ? 2-They should establish a connection first, then use the $filter array statement with mysql_real_escape_string ?

    Read the article

  • How can I reduce the number of loops in this VIEW in Rails when using :collection?

    - by Angela
    I am using the :collection to go through all the Contacts that are part of a given Campaign. But within that Campaign I check for three different Models (each with their own partial). Feels like I am going through the list of Contacts 3x. How can I make this alot leaner? <h2>These are past due:</h2> <% @campaigns.each do |campaign| %> <h3>Campaign: <%= link_to campaign.name, campaign %></h3> <strong>Emails in this Campaign:</strong> <% for email in campaign.emails %> <h4><%= link_to email.title, email %> <%= email.days %> days</h4> <% @contacts= campaign.contacts.find(:all, :order => "date_entered ASC" )%> <!--contacts collection--> <!-- render the information for each contact --> <%= render :partial => "contact_email", :collection => @contacts, :locals => {:email => email} %> <% end %> Calls in this Campaign: <% for call in campaign.calls %> <h4><%= link_to call.title, call %> <%= call.days %> days</h4> <% @contacts= campaign.contacts.find(:all, :order => "date_entered ASC" )%> <!--contacts collection--> <!-- render the information for each contact --> <%= render :partial => "contact_call", :collection => @contacts, :locals => {:call => call} %> <% end %> Letters in this Campaign: <% for letter in campaign.letters %> <h4><%= link_to letter.title, letter %> <%= letter.days %> days</h4> <% @contacts= campaign.contacts.find(:all, :order => "date_entered ASC" )%> <!--contacts collection--> <!-- render the information for each contact --> <%= render :partial => "contact_letter", :collection => @contacts, :locals => {:letter => letter} %> <% end %> <% end %>

    Read the article

  • expand div with focus-jquery

    - by Joel
    Hi guys, I'm revisiting this after a few weeks, because I could never get it to work before, and hoping to now. Please look at this website-notice the newsletter signup form at the top right. http://www.rattletree.com I am wanting it to look exactly this way for now, but when the user clicks in the box to enter their email address, the containing div will expand (or simply appear) above the email field to also include a "name" and "city" field. I'm using jquery liberally in the sight, so that is at my disposal. This form is in the header so any id info, etc can't be withing the body tag... This is what I have so far: <div class="outeremailcontainer"> <div id="emailcontainer"> <?php include('verify.php'); ?> <form action="index_success.php" method="post" id="sendEmail" class="email"> <h3 class="register2">Newsletter Signup:</h3> <ul class="forms email"> <li class="email"><label for="emailFrom">Email: </label> <input type="text" name="emailFrom" class="info" id="emailFrom" value="<?= $_POST['emailFrom']; ?>" /> <?php if(isset($emailFromError)) echo '<span class="error">'.$emailFromError.'</span>'; ?> </li> <li class="buttons email"> <button type="submit" id="submit">Send</button> <input type="hidden" name="submitted" id="submitted" value="true" /> </li> </ul> </form> <div class="clearing"> </div> </div> css: p.emailbox{ text-align:center; margin:0; } p.emailbox:first-letter { font-size: 120%; font-weight: bold; } .outeremailcontainer { height:60px; width: 275px; background-image:url(/images/feather_email2.jpg); /*background-color:#fff;*/ text-align:center; /* margin:-50px 281px 0 auto ; */ float:right; position:relative; z-index:1; } form.email{ position:relative; } #emailcontainer { margin:0; padding: 0 auto; z-index:1000; display:block; position:relative; } Thanks for any help! Joel

    Read the article

  • Sliding panel in the middle of the page. Z-index given not working

    - by Nehal Rupani
    Hi all, I am implementing sliding panel element but problem is when i slide out other div element is floating down. I guess and tried to give z-index to element which i am sliding but it doesn't seems to work. Let me put code for both div. <div class="vrcontrol"> <div class="slide-out-div"> <a class="handle" href="http://link-for-non-js-users.html">Content</a> <h3>Contact me</h3> <p>Thanks for checking out my jQuery plugin, I hope you find this useful. </p> <p>This can be a form to submit feedback, or contact info</p> </div> This is div which i am sliding in and out and beneath is code of effective div. <div class="askform"> <p class="titletext">Ask an Expert Trade Forum</p> <p class="detailtext">WD-40’s leading source for DIY tips and tricks.</p> <span> <form id="askform" name="askform" action="" method="post"> <span class="left"><input name="input" type="text" class="askinputbox"/></span><span class="marginleft"><input type="image" src="images/search_icon.gif" /></span> </form> </span> <div class="followus"> <span class="followtext">Follow us on</span><span class="right"><img src="images/bookmark.jpg" width="121" height="45" alt="Bookmark" /></span> </div> </div> Sliding div is in left portion of the page and effective div is in right portion of the page. I guess something with z-index, positioning element and overflow properties will do something.

    Read the article

  • Using one data source across multiple views in Kendo UI SPA

    - by user3731783
    I am trying to build a Kendo UI SPA. I have two views. View 1 (appListView) shows Application Details in a grid and view 2 (activityView) will have a dropdown for application names and a grid that shows the activity for selected application As I am loading all the application details on the loading of view 1, I would like to re-use those details to populate the dropdown on view 2. Please see my code below. Everything works fine but when I go to View 2 it makes a call to the service again to get application details. I would like to use the existing data if it is already loaded and if the uses comes to view 2 directly then it should get application data also. I am not sure what I am missing in the code. View Markup: <script id="appListView" type="text/x-kendo-template"> <h3 data-bind="html: displayName"></h3> <div data-role="grid" data-editable="{'mode':'popup'}" data-bind="source: items" data-columns="[ {'field': 'Name'}, {'field': 'ContactEmail','title':'Contact Email'} ]"> </div> </script> <script id="" type="text\x-kendo-template"> <div> Activity for Application&nbsp;&nbsp; <input name="AppName" data-role="dropdownlist" data-source="appsModel.items" data-text-field="Name" data-value-field="Id" data-option-label="Choose an application name" style="width:250px;" /> </div> <div id="Activities" data-role="grid" data-bind="source: items" data-auto-bind="false" data-columns="[ {'field': 'Domain','title':'Domain'}, {'field': 'ActivityType','title':'Activity Type'} ]"> </div> </script> js with DataSource and View Model: //data sources var applications = new kendo.data.DataSource({ schema: { model: { id: "Id" } }, serverFiltering : true, transport: { read: { url: '/api/App', dataType: 'json', type:'GET' } } }); var activities = new kendo.data.DataSource({ schema: { model: { id: "Id" } }, transport: { read: { url: '/api/Activity', dataType: 'json', type: 'GET' }, parameterMap: function (data, type) { if (type == "read") { return 'appId=' + $("#AppName").val() ; } } } }); //Models var appsModel = kendo.observable({ items: applications, displayName: 'My Applications' }); var activityModel = kendo.observable({ items: activities, onAppChange: function(t){ $("#Activities").data("kendoGrid").dataSource.read(); }, dispayName: 'Application Activities' }); //views var layout = new kendo.Layout("layout-template"); var appListView = new kendo.View("appListView", { model: appsModel }); var activityView = new kendo.View("activityView", { model: activityModel }); Thank you for taking time to read this long question.

    Read the article

  • How to store result of drag and drop as a image

    - by Jimmy
    I want to take the screenshot of the result of drag and drop, but I don't know how to do. Actually, I found 2 javascript and using HTML5 such as html2canvas and canvas2image. I am now combining them together, but it's still meet some problem with the canvas2image. Please help me solve this problem if you have same experience, thank you a lot. Please help me, I've been stock here for days. Drag and drop code. <script> $(function() { $( "#draggable" ).draggable(); $( "#draggable2" ).draggable(); $( "#droppable" ).droppable({ hoverClass: "ui-state-active", drop: function( event, ui ) { $( this ) .addClass( "ui-state-highlight" ) .find( "p" ) .html( "Dropped!" ); } }); }); </script> Image generation code <script> window.onload = function() { function convertCanvas(strType) { if (strType == "JPEG") var oImg = Canvas2Image.saveAsJPEG(oCanvas, true); if (!oImg) { alert("Sorry, this browser is not capable of saving " + strType + " files!"); return false; } oImg.id = "canvasimage"; oImg.style.border = oCanvas.style.border; oCanvas.parentNode.replaceChild(oImg, oCanvas); } function convertHtml(strType) { $('body').html2canvas(); var queue = html2canvas.Parse(); var canvas = html2canvas.Renderer(queue,{elements:{length:1}}); var img = canvas.toDataURL(); convertCanvas(strType); window.open(img); } document.getElementById("html2canvasbtn").onclick = function() { convertHtml("JPEG"); } } </script> HTML code <body> <h3>Picture:</h3> <div id="draggable"> <img src='http://1.gravatar.com/avatar/1ea64135b09e00ab80fa7596fafbd340? s=50&d=identicon&r=R'> </div> <div id="draggable2"> <img src='http://0.gravatar.com/avatar/2647a7d4b4a7052d66d524701432273b?s=50&d=identicon&r=G'> </div> <div id="dCanvas"> <canvas id="droppable" width="500" height="500" style="border: 2px solid gray" class="ui-widget-header" /> </div> <input type="button" id="bGenImage" value="Generate Image" /> <div id="dOutput"></div> </body>

    Read the article

  • CSS Hidden DIV Form Submit

    - by Michael
    Using CSS, when a link is clicked it brings up a hidden DIV that contains a form. The user will then enter information and then submit the form. I'd like the hidden DIV to remain visisble, and a 'success message' to be displayed after submission. Then the user will have the option of closing the DIV. I can't get it to work without reloading the page, which causes the DIV to become hidden again. Any ideas? <body> <a href="javascript:showDiv()" style="color: #fff;">Click Me</a> <!--POPUP--> <div id="hideshow" style="visibility:hidden;"> <div id="fade"></div> <div class="popup_block"> <div class="popup"> <a href="javascript:hideDiv()"> <img src="images/icon_close.png" class="cntrl" title="Close" /> </a> <h3>Remove Camper</h3> <form method="post" onsubmit="email.php"> <p><input name="Name" type="text" /></p> <p><input name="Submit" type="submit" value="submit" /></p> </form> <div id="status" style="display:none;">success</div> </div> </div> </div> <!--END POPUP--> <script language=javascript type='text/javascript'> function hideDiv() { if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById('hideshow').style.visibility = 'hidden'; } else { if (document.layers) { // Netscape 4 document.hideshow.visibility = 'hidden'; } else { // IE 4 document.all.hideshow.style.visibility = 'hidden'; } } } function showDiv() { if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById('hideshow').style.visibility = 'visible'; } else { if (document.layers) { // Netscape 4 document.hideshow.visibility = 'visible'; } else { // IE 4 document.all.hideshow.style.visibility = 'visible'; } } } </script> </body>

    Read the article

  • How can I create a Searchstring for a Google AJAX Search API?

    - by elmaso
    Hello, i have this code to get the search resutls from the api: querygoogle.php: <?php session_start(); // Here's the Google AJAX Search API url for curl. It uses Google Search's site:www.yourdomain.com syntax to search in a specific site. I used $_SERVER['HTTP_HOST'] to find my domain automatically. Change $_POST['searchquery'] to your posted search query $url = 'http://ajax.googleapis.com/ajax/services/search/web?rsz=large&v=1.0&start=20&q=' . urlencode('' . $_POST['searchquery']); // use fopen and fread to pull Google's search results $handle = fopen($url, 'rb'); $body = ''; while (!feof($handle)) { $body .= fread($handle, 8192); } fclose($handle); // now $body is the JSON encoded results. We need to decode them. $json = json_decode($body); // now $json is an object of Google's search results and we need to iterate through it. foreach($json->responseData->results as $searchresult) { if($searchresult->GsearchResultClass == 'GwebSearch') { $formattedresults .= ' <div class="searchresult"> <h3><a href="' . $searchresult->unescapedUrl . '">' . $searchresult->titleNoFormatting . '</a></h3> <p class="resultdesc">' . $searchresult->content . '</p> <p class="resulturl">' . $searchresult->visibleUrl . '</p> </div>'; } } $_SESSION['googleresults'] = $formattedresults; header('Location: ' . $_SERVER['HTTP_REFERER']); exit; ?> search.php <?php session_start(); ?> <form method="post" action="querygoogle.php"> <label for="searchquery"><span class="caption">Search this site</span> <input type="text" size="20" maxlength="255" title="Enter your keywords and click the search button" name="searchquery" /></label> <input type="submit" value="Search" /> </form> <?php if(!empty($_SESSION['googleresults'])) { echo $_SESSION['googleresults']; unset($_SESSION['googleresults']); } ?> but with this code, I cant add a searchstring.. how can i add a search string like search.php?search=keyword ? thanks

    Read the article

  • Wordpress Events List Date Problem

    - by Roger
    Hi, I'm having a problem displaying events in the correct order in wordpress. I think the problem is because wordpress is treating the date as a string and ordering it by the day because it's in british date format. The goal is to display a list of future events with the most current event at the top of the list. But I must use the british date format of dd/mm/yyyy. Do I need to go back to the drawing board or is there a way of converting the date to achieve the result I need? Thanks in advance :) <ul> <?php // Get today's date in the right format $todaysDate = date('d/m/Y');?> <?php query_posts('showposts=50&category_name=Training&meta_key=date&meta_compare=>=&meta_value=' . $todaysDate . '&orderby=meta_value&order=ASC'); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <li> <h3><a href="<?php the_permalink(); ?>"> <?php the_title(); ?> </a></h3> <?php $getDate = get_post_meta($post->ID, 'date', TRUE); $dateArray = explode('/', $getDate); ?> <?php if($getDate != '') { ?> <div class="coursedate rounded"><?php echo date('d F Y', mktime(0, 0, 0, $dateArray[1], $dateArray[0], $dateArray[2])); ?></div> <?php } ?> <p><?php get_clean_excerpt(140, get_the_content()); ?>...</p> <p><strong><a class="link" href="<?php the_permalink(); ?>">For further details and booking click here</a></strong></p> </li> <?php endwhile; ?> <?php else : ?> <li>Sorry, no upcoming events!</li> <?php endif; ?>

    Read the article

  • Wordpress plugin $post

    - by Jordan Pagaduan
    I have already get how to insert in the database. My only problem is to get the value of text box to insert in the database. Here is my code: function dbAdd() { global $wpdb; $new_title = $_POST['new_title']; $new_author = $_POST['new_author']; $new_url = $_POST['new_url']; if($wpdb->insert('wp_podcast_data', array( 'mp3_id' => '', 'title' => '$new_title', 'creator' => '$new_author', 'url' => '$new_url') )) { echo"<h1>Save Successfully!</h1>"; }else { echo mysql_error(); } } ---------------------------------------------------------- function player_manager_index() { if($_SERVER['REQUEST_METHOD']=='POST') { dbAdd(); } ?> <h3>Podcast Player Manager (This Plug is not yet finish)</h3><br /> <p>Note: This Player Manager needs the URL of mp3 file that you want to include in your podcast player.</p> <form method="post" action=""> <label for="new_title" style="display:block; padding-top: 5px; cursor: default;">Title</label><input type="text" id="new_title" name="new_title" size="50" /> <label for="new_author" style="display:block; padding-top: 5px; cursor: default;">Author</label><input type="text" id="new_author" name="new_author" size="50" /> <label for="new_url" style="display:block; padding-top: 5px; cursor: default;">URL</label><input type="text" id="new_url" name="new_url" size="50" /> <div><input type="submit" value="Add New" style="margin-left: 20px; margin-top: 15px;" /></div> </form> Please Help me. I'm newbie in wordpress. Thank you so much.

    Read the article

  • jQuery i++ and i-- problems ... what on earth???

    - by michael
    Could someone please tell me what I am doing wrong? I'm not a newbie at programming but I feel like it tonight! Every time I increment the incrementing variable it throws a fit! When add one to it, it behaves fine, but if I try to add one more to it it wants to add 2 more. And then if I try to de-increment it wants to subtract from the original number that it was assigned to. I've tried: i++; i = i+1; i = i++; Nothing seems to work. It's got to be a stupid mistake. Press the buttons to increment and de-increment. http://michaelreynolds.net/iphone/ here's the code: var dayNum = 30; //---------------------------------------------------------------------- $.jQTouch({ icon: 'dailyqoteicon.png', statusBar: false, initializeTouch: 'a.touch' }); //---------------------------------------------------------------------- $(document).ready(function(){ //$(function(){}); $(function(){ $('a.touch').swipe( function(event, info){ //alert("jQTouch swipe event"); //alert(info.direction); }); }); $(function updateVerse(){ //alert("updateVerse called"); $.ajax({ type: "GET", dataType: 'JSON', data: 'day='+ dayNum, url: 'forward.php', success: function(data){ var obj = $.parseJSON(data); $("h2.quote").html(""); $("h3.reference").html(""); $("h2.quote").append(obj.quote); $("h3.reference").append(obj.reference, " ", obj.version); //$("span.version").append(obj.version); //----------------------------------- // JSON string {"id":"1","quote":"For to me, to live is Christ, and to die is gain","reference":"Philippians 1:21","version":"NKJV"} }, error: function(request, error){ alert("problem retrieving json data string"); } }); function addDayNum(){ dayNum = dayNum + 1; //dayNum = dayNum++; } function subDayNum(){ dayNum = dayNum - 1; //dayNum = dayNum--; } $("div#header a.next").tap( function(){ addDayNum(); //dayNum++;// doesn't work at all //dayNum = dayNum + 1;//doesn't work at all updateVerse(); //alert(dayNum); //alert("next clicked"); }); $("div#header a.prev").live('click', function(){ subDayNum(); //dayNum--;//doesn't work at all //dayNum = dayNum - 1;// doesn't work at all updateVerse(); //alert(dayNum); //alert("previous clicked"); }); }); });

    Read the article

  • codeIgniter: pass parameter to a select query from previous query

    - by krike
    I'm creating a little management tool for the browser game travian. So I select all the villages from the database and I want to display some content that's unique to each of the villages. But in order to query for those unique details I need to pass the id of the village. How should I do this? this is my code (controller): function members_area() { global $site_title; $this->load->model('membership_model'); if($this->membership_model->get_villages()) { $data['rows'] = $this->membership_model->get_villages(); $id = 1;//this should be dynamic, but how? if($this->membership_model->get_tasks($id)): $data['tasks'] = $this->membership_model->get_tasks($id); endif; } $data['title'] = $site_title." | Your account"; $data['main_content'] = 'account'; $this->load->view('template', $data); } and this is the 2 functions I'm using in the model: function get_villages() { $q = $this->db->get('villages'); if($q->num_rows() > 0) { foreach ($q->result() as $row) { $data[] = $row; } return $data; } } function get_tasks($id) { $this->db->select('name'); $this->db->from('tasks'); $this->db->where('villageid', $id); $q = $this->db->get(); if($q->num_rows() > 0) { foreach ($q->result() as $task) { $data[] = $task; } return $data; } } and of course the view: <?php foreach($rows as $r) : ?> <div class="village"> <h3><?php echo $r->name; ?></h3> <ul> <?php foreach($tasks as $task): ?> <li><?php echo $task->name; ?></li> <?php endforeach; ?> </ul> <?php echo anchor('site/add_village/'.$r->id.'', '+ add new task'); ?> </div> <?php endforeach; ?> ps: please do not remove the comment in the first block of code!

    Read the article

  • I am unsure of how to access a persistence entity from a JSP page?

    - by pharma_joe
    Hi, I am just learning Java EE, I have created a Persistence entity for a User object, which is stored in the database. I am now trying to create a JSP page that will allow a client to enter a new User object into the System. I am unsure of how the JSP page interacts with the User facade, the tutorials are confusing me a little. This is the code for the facade: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Add User to System</title> </head> <body> <h2>Add User</h2> <h3>Please fill out the details to add a user to the system</h3> <form action=""> <label>Email:</label> <input type="text" name="email"><br /> <label>Password:</label> <input type="password" name="name"><br /> <label>Name:</label> <input type="text" name="name"><br /> <label>Address:</label> <input type="text" name="address"><br /> <label>Type:</label> <select name="type"> <option>Administrator</option> <option>Member</option> </select><br /> <input type="submit" value="Add" name="add"/> <input type="reset" value="clear" /> </form> </body> This is the code I have to add a new User object within the User facade class: @Stateless public class CinemaUserFacade { @PersistenceContext(unitName = "MonashCinema-warPU") private EntityManager em; public void create(CinemaUser cinemaUser) { em.persist(cinemaUser); } I am finding it a little difficult to get my head around the whole MVC thing, getting there but would appreciate it if someone could turn the light on for me!

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >