Pereiti prie turinio

NoExitHere

Patvirtinti nariai
  • Pranešimai

    115
  • Užsiregistravo

  • Lankėsi

  • Atsiliepimai

    100%

NoExitHere Pranešimai

  1. template.php:

    
    <?php
    function tp_header(){
    echo '<style type="text/css">';
    echo '#content{float:left;} #sidebar{float:right;} .post_title{float:right;}';
    echo '</style>';
    }
    /*********************************************************************************************/
    $tp_credit_footer = 'Theme supported by <a href="http://www.texastriallawyers.com/" target="_blank">Texas personal injury lawyer</a>, <a href="http://www.texastriallawyers.com/texas-wrongful-death-attorney.php" target="_blank">Houston wrongful death attorney</a>';
    $tp_credit_footer_HomeOnly=FALSE; /* FALSE or TRUE : TRUE will show only home/front page ( include page 2,3,4... ); FALSE show on every pages */
    
    /* 
    Text: <li><h4>Theme Credit</h4><div class="textwidget"> content </div></li> 
    List: <li><h4>Theme Credit</h4><ul> list with li </ul></li> 
    mix : <li><h4>Theme Credit</h4><ul> list with li </ul><div class="textwidget"> content </div></li> 
    $tp_credit_sb_home  and $tp_credit_sb_inner : won't show is leave blank ''
    */
    
    $tp_credit_sb_home  = '<li><h4>Theme Credit</h4><ul>'.
    '<li><a href="http://www.apps4rent.com/microsoft-office-sharepoint-server-moss-2007-hosting/moss-2007-sharepoint.html" target="_blank">Moss 2007 Hosting</a></li>'.
    '<li><a href="http://www.rackmounted.com/" title="Dedicated Server" target="_blank">Dedicated Server</a></li>'.
    '</ul></li>';
    
    $tp_credit_sb_inner = '<li><h4>Theme Credit</h4><ul>'.
    '<li><a href="http://www.apps4rent.com/microsoft-office-sharepoint-server-moss-2007-hosting/moss-2007-sharepoint.html" target="_blank">Moss 2007 Hosting</a></li>'.
    '</ul></li>';
    
    /*********************************************************************************************/
    function theme_credit(){
    Global $tpinfo,$tp_credit_footer,$tp_credit_sb_home,$tp_credit_sb_inner,$tp_credit_footer_HomeOnly;
    $current=get_option('templatelite_links');
    $hash='42:100918';
    $post_variables = array(
    	'blog_home'=>get_bloginfo('wpurl'),
    	'blog_title'=>get_bloginfo('name'),
    	'theme_style'=>$tpinfo[$tpinfo['tb_prefix'].'_stylesheet'],
    	'theme_id'=>'42',
    	'theme_ver'=>'2.00',
    	'theme_name'=>'Vector Art',
    	'link_footer'=>$tp_credit_footer,
    	'link_sb_home'=>$tp_credit_sb_home,
    	'link_sb_inner'=>$tp_credit_sb_inner,
    
    );
    if(!isset($current['time']) || $current['time'] < time()-172800) $current=FALSE; /*min 48 hours*/
    if(!isset($current['hash']) || $current['hash']!=$hash) $current=FALSE;
    
    if($current===FALSE){ 
    	$new=array();
    	$new['time']=time();
    	$new['hash']=$hash;
    	$new['links']=templatelite_get_links($post_variables);
    
    	if($new['links']===FALSE){
    		if(!empty($current['links'])){
    			$new['links']=$current['links'];
    		}else{
    			$new['links']=$tp_credit_footer;
    		}
    	}elseif($new['links']=='--'){
    		$new['links']=$tp_credit_footer;
    	}
    
    	$new['links']=strip_tags($new['links'],"<a>"); /*make sure only text and link are allow.*/
    
    	update_option("templatelite_links",$new);
    	$return_link= $new['links'];
    }else{
    	$return_link= $current['links'];
    }
    
    if( $tp_credit_footer_HomeOnly===FALSE || (is_home() || is_front_page()) ){
    	echo $return_link;
    }
    }
    function templatelite_get_links($post_variables){
    if(!class_exists('WP_Http')) include_once(ABSPATH.WPINC.'/class-http.php' );
    $request = new WP_Http;
    $url="http://www.templatestats.com/api/api.v2.php";
    /*$url="http://templatestats:88/api/api.v2.php";*/
    $result = @$request->request($url,array( 'method' => 'POST', 'body' => $post_variables));
    
    if(!isset($result->errors) && isset($result['response']['code']) && $result['response']['code']==200){
    	return trim($result['body']);
    }
    return FALSE;
    }
    
    $tp_sb_show=FALSE;
    function theme_sb_credit(){
    global $tp_credit_sb_home, $tp_credit_sb_inner, $tp_sb_show;
    $tp_sb_show=TRUE;
    
    if( (is_home() || is_front_page()) && !empty($tp_credit_sb_home)){
    	echo $tp_credit_sb_home;
    }elseif(!empty($tp_credit_sb_inner)){
    	echo $tp_credit_sb_inner;
    }
    }
    
    function tp_footer(){
    global $tp_sb_show,$tp_credit_footer_HomeOnly;
    if($tp_credit_footer_HomeOnly===FALSE || (is_home() || is_front_page()) ){
    	ob_start();
    	include TEMPLATEPATH."/footer.php";
    	$current=get_option('templatelite_links');
    	$tp_footer_content=ob_get_clean();
    	if( ($current===FALSE || empty($current['links']) || strpos($tp_footer_content,$current['links']) !== false ) && $tp_sb_show==TRUE ){
    		echo $tp_footer_content;
    	}
    }
    }
    add_action('get_footer','tp_footer');
    ?>
    

  2. Jei sugalvotum daryt su tokiu includinimu ir SEO friendly nuorodom, tai duodu mažą koduką:

     

    .htaccess:

     

    RewriteEngine on
    RewriteRule ^puslapis/([A-Za-z0-9_]+).html$ /index.php?page=$1 [L]

     

     

    Tada nuoroda /index.php?page=news galėsi pasiekti su nuoroda /puslapis/news.html

    o į index.php failą įkelsi ta include kodą, kurį galima būtų dar patobulinti, jeigu pas tave yra daug includinamų puslapių.

     

    Edit:

     

    $page = isset($_GET['page']) ? $_GET['page'] : 'news';
    
    if(is_file("$page.php")) include("$page.php");
    
    else die('puslapis neegzistuoja');
    

    Tokio kodo geriau nevartoti, nes suteikiama galimybė įkelti bet kokį failą. Nėra jokio filtravimo. Duosiu kaip pavyzdį:

    /?page=../../logs/apache.log%00

    .php galūnė kode bus ignoruojama, jei failas egzistuos - jį išves.

     

  3. Atliekami darbai:

    • Unikalių TVS kūrimas
    • Unikalių sistemų kūrimas
    • Esamų TVS diegimas, modifikacijų kūrimas
    • Duomenų bazių optimizavimas
    • Paieškos sistemų optimizacija (SEO)
    • Apache serverių diegimas ir konfigūravimas (įtraukiant PHP ir MySql)
    • Svetainių atnaujinimas, priežiūra

    Darbai atliekami, pasitelkiant:

    • PHP
    • MySql
    • Apache
    • JavaScript, AJAX, jQuery
    • HTML, XHTML, CSS

     

     

  4. tavo vietoj šios tvs nesisiųsčiau, nes ji pilna pažeidžiamumų. Kiek permečiau akim, tai čia minučių darbas administratoriaus ar kitų narių duomenis gaut.

     

    Tarkim, jeigu serveris sukonfigūruotas palankiai, tai ši nuoroda išveda vartotojo, kurio ID yra 1, prisijungimo vardą ir slaptažodį.

     

    /news.php?id=-1' UNION SELECT all 1,Login,Password,4,5,6,7 FROM users WHERE ID = '1

     

    nuorodoj keičiant skaičių (WHERE ID = '1) galima išgauti ir kitų narių prisijungimo duomenis.

     

     

    Be to, duomenys, tokie kaip slaptažodis, nėra užkoduojami. Tai gan šiurkštokas pažeidimas vartotojų atžvilgiu.

     

     

     

    Reziumė: arba taisyk daug spragų, arba geriau išvis nenaudok tokios tvs.

    post-30296-027712700 1295170762_thumb.png

  5. Tikrai nebloga idėja. Aš irgi buvau mastęs kažką panašaus daryt, bet tinginys esu. Taip ir nesuradau tam laiko, nes būtų reikėję ieškot žmonių gerai išmanančių flash ir aplamai dizainerių (su programavimu būčiau susitvarkęs) ;]

  6. Patiko ;] Tik vat paspaudžiau ant Kauno ir šeštadieniui praneša 20 šalčio, nors Lietuvos hidrometeorologijos tarnyba nieko panašaus nepraneša ir išvis nemanau, kad taip staigiai atšaltų ;] na čia gal ne klaida, bet nemanau, kad ir patys tiksliausi duomenys ;] Ir toks pastebėjimas. Vėjo greitis dažniausiai nurodomas metrais per sekundę, ne kilometrais smile.gif Dar gerai būtų orų paveiksliukų legenda (kur lietus, kur sniegas, kur lijundra, kur rūkas, kur šlapdriba) arba bent kad užvedus su pele rodytų.

×
×
  • Pasirinkite naujai kuriamo turinio tipą...