Jump to content

shmideo

Members
  • Posts

    63
  • Joined

  • Last visited

Everything posted by shmideo

  1. Hi I have a MySql database and wondered if there is a code to search a table field with a given string and display the number of unique occurrences. The table is asterisk_cdr and would like to know how many calls received daily on a perticular channel. Thanks shmideo
  2. Thank you so much Ch0cu3r for that, it works! Strangely though when clicking on the search the word no long dissapears, so you have to overwrite it for your search query wheres before it cleared when clicked. Thanks Shmideo
  3. Hey guys Been working on a little code to display the word 'Search' is different langages depending on the url, ie. /es etc. I think I am very close. The code just displays the $ rather the value. Code is below: Thanks Shnideo <?php /* Multi Language Search */ $pageURL = $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; if(preg_match("~/de/~",$pageURL)){ $search_language = "Suche"; }elseif(preg_match("~/it/~",$pageURL)){ $search_language = "Ricerca"; }elseif(preg_match("~/sv/~",$pageURL)){ $search_language = "Sökning"; }elseif(preg_match("~/nb/~",$pageURL)){ $search_language = "Søk"; }elseif(preg_match("~/fr/~",$pageURL)){ $search_language = "Recherche"; }elseif(preg_match("~/nl/~",$pageURL)){ $search_language = "Zoeken"; }elseif(preg_match("~/es/~",$pageURL)){ $search_language = "Buscar"; }elseif(preg_match("~/en/~",$pageURL)){ $search_language = "Search"; }else{ $search_language ="Søg"; } ?> <div id="search"> <form id="searchform" method="get" action="<?php bloginfo('url'); ?>/"> <fieldset> <input id="s" type="text" value= echo $search_language name="s" class="text" onblur="if(this.value == '') this.value = '$search_language';" onfocus="if(this.value == '$search_language') this.value = '';" /> <input id="x" type="submit" value="" class="button" /> </fieldset> </form> </div>
  4. Thank you so much guys! Shmideo
  5. Hi guys Trying to modify code to add an href but the syntaxt is wrong. Getting Parse error is on the last line, $banner_location. I think it's to do with the <>, but not sure. Ttried variations but keeps erroring, hope someone can help. Thanks! <?php $pageURL = $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; if(preg_match("~/de/~",$pageURL)){ $page_language = "de"; }elseif(preg_match("~/en/~",$pageURL)){ $page_language = "en"; }else{ $page_language ="dk"; } $banner_location = "http://".$_SERVER['SERVER_NAME']."/images/".$page_language.".png" <a href="http://".$_SERVER['SERVER_NAME']."/tilfredshedsgaranti-".$page_language.;</a> ?>
  6. Well I used this snippet to display a ribbon banner depending on the URL for the 9 languages, but I am not sure. The syntax is coming up in Dreamweaver. The 9 forms have been set using gravityforms in WP and each has an ID. As it worked manually for one ID I'm thinking it should work dynamically?
  7. Thanks mentalist, this is MKII. Took this off a previoust post, but the syntax is failing for last line but one (gravityform). I have 9 callback forms and would like to add this to the WP sidebar.php so it would display the relevant 'form ID' relative to the URL. (/en, etc). Think I'm close, maybe. <?php $pageURL = $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; if(preg_match("~/de/~",$pageURL)){ $page_language = "4"; }elseif(preg_match("~/it/~",$pageURL)){ $page_language = "5"; }elseif(preg_match("~/sv/~",$pageURL)){ $page_language = "6"; }elseif(preg_match("~/nb/~",$pageURL)){ $page_language = "7"; }elseif(preg_match("~/fr/~",$pageURL)){ $page_language = "8"; }elseif(preg_match("~/nl/~",$pageURL)){ $page_language = "9"; }elseif(preg_match("~/it/~",$pageURL)){ $page_language = "10"; }elseif(preg_match("~/es/~",$pageURL)){ $page_language = "3"; }elseif(preg_match("~/en/~",$pageURL)){ $page_language = "11"; }else{ $page_language ="2"; } [gravityform id=.$page_language. title=true description=true]; **** failing sntax error **** ?> Note, I manually tested [gravityform id=3 title=true description=true] in a wordpress page and it displayed the form ok,
  8. Hey guys I have a basic sidebar callback form and I am trying to get it to show the form title and description depending on the country url, for example /en or /es, etc. The code below shows the title specified in the WP widget which is "We can call you" and a line of description text. I have an idea what to do but not sure, maybe set $display_description and $display_title and use elsif? I realise I will have to have translated text for each language. Thanks shmideo if($display_title || $display_description){ $form_string .= " <div class='gform_heading'>"; if($display_title){ $form_string .= " <h3 class='gform_title'>" . $form['title'] . " </h3>"; } if($display_description){ $form_string .= " <span class='gform_description'>" . rgar($form,'description') ."</span>"; } $form_string .= " </div>"; }
  9. I've figured it out how to also show the default country. Thanks for your solution it works great!
  10. Hey QuickOldCar it worked! Just need a modification to show the default country image url,ie url without the / (nordiccall.dk) Thanks shmideo
  11. Here's the link: http://nordiccall.dk/
  12. Yes I cannot find where it actually gets the image name from. I know where the image is on the server but that's about all. Have checked Wordpress and nowhere I can see where the image is (corner_banner.png). Have done a content search for the image name on the server and no sign of it. Thanks shmideo
  13. Hi all Our website has 9 languages and I have a ribbon banner graphic placed on top of the header. I would like to know if it is possible to have 9 images (one for each) for the languages but to show the image corresponding to the country chosen, for example /en or /fr etc. Using wordpress 3.6 The image looks for a page /satisfaction-guarantee/ and will go to the relevant country on click, eg, /en/satisfaction-guarantee/ etc. Would love to know how to do the same kind of thing for the actual ribbon banner also. Thanks shmideo The code that shows the banner is below: <div id="inner_wraper"> <div class="menu_wrap"> <div id="header"> <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'my_nav','sort_column'=>'menu_order' ) ); ?> </div> </div> <div class="clear"></div> <div class="slider_logo_wrap"> <div id="top_banner"> <a href="<?php bloginfo('url')?>/satisfaction-guarantee/"><img src="<?php echo get_option('banner_image'); ?>" alt=" "/></a> </div>
  14. Looking forward to learning things yet to discover! Thanks Shmideo
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.