Jump to content
poterasal

Help Cod

Recommended Posts

Posted

Salutare.

Am un cod luat de pe un CMS de la cineva este cu date meteo si curs valutar.Problema este ca nu stiu/nu imi pot da seama cum il pot face pentru wordpress,nu stiu ce coduri trebuiesc editate/adaugate.

Cod:

  <div class="vremea">
<?
// Always globalize $wpdb
global $wpdb;
$key="constanta";
$data=mktime(19,0,0);
$sql = "SELECT * FROM $wpdb->vremea
INNER JOIN $wpdb->vremea_locatii ON $wpdb->vl_id = $wpdb->v_locatie
WHERE $wpdb->v_data = '".$data."'
AND $wpdb->vl_key = '".$key."'
LIMIT 1";
$res = $wpdb->get_results($sql);
if(num($res) == 0) {
$sql = "SELECT * FROM $wpdb->vremea
INNER JOIN $wpdb->vremea_locatii ON $wpdb->vl_id = $wpdb->v_locatie
WHERE $wpdb->vl_key = '".$key."'
ORDER BY $wpdb->v_data DESC
LIMIT 1";
$res = $wpdb->get_results($sql);
}
$row = $wpdb->fetch($res);
?>
<?=$row['$wpdb->vl_denumire']?>, <?=$row['$wpdb->v_min']."-".$row['$wpdb->v_max']?>° C
<img src="<?=$row['$wpdb->v_icon_url']?>" alt="<?=$row['$wpdb->v_conditions']?>" title="<?=$row['$wpdb->v_conditions']?>" width="24" height="24" /> |
<a href="<?=ABS_PATH?>starea-vremii" class="alte-locatii">alte locatii</a>
</div>
<div class="curs">
<a href="<?=ABS_PATH?>curs-valutar">Curs valutar</a>
<div class="monede">
<? scrieEvolutieCurs(); ?>
</div>
</div>
<div class="social">
<span class="social-label">
<a href="<?=ABS_PATH?>trimite-o-stire">Trimite-ne o stire</a>
<span class="desp">|</span>
Urmareste-ne si pe
</span>
<div class="media">
<a href="#" class="fb" target="_blank"></a>
<a href="#" class="tw" target="_blank"></a>
<a href="#" class="pi" target="_blank"></a>
</div>
</div>
</div>
<div id="header">
<div class="logo">
<a href="<?=ABS_PATH?>"><img src="<?=ABS_PATH?>img/logo.png" alt="<?=CLIENT?> logo" width="240" height="54" /></a>
<div class="logoText">TEXT</div>
</div>
<div class="search">
<div class="wrapper">
<form action="" method="post" autocomplete="off" id="search-form">
<input type="text" name="freesearch" id="freesearch" data-placeholder="Cauta în site" value="Cauta în site" />
<span class="buton" id="freesearch-submit"><i class="fa fa-search"></i></span>
</form>
</div>

Sau daca cineva imi poate coda aceste functii pentru wordpress ar fi super ok.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...