Welcome, Guest. Please login or register.

Author Topic: Problema script descarca  (Read 1472 times)  Share 

0 Members and 1 Guest are viewing this topic.

Offline cnusi

  • Sr. Member
  • ****
  • Posts: 575
  • Reputation: +110/-36
  • Gender: Male
    • View Profile
    • ATACpeNET
Problema script descarca
« on: July 15, 2014, 09:12:51 AM »
scriptul de download nu m-ai functioneaza, il am pus in single.php
 arata cam asa:
Code: [Select]
<?php get_header(); ?>


<?php get_sidebar(); ?>


<div id="index">


<?php 


      
if (have_posts()) : the_post();
      
$descarcari get_post_metaget_the_id(), 'descarcari' ,true);
      
?>



      <div id="bara-sus">


         <div class="stanga">


            Categorii: <?php


            $categories 
get_the_category();


            
$separator ', ';


            
$output '';


            if(
$categories){


            foreach(
$categories as $category) {


            
$output .= '<a href="'.get_category_link($category->term_id ).'" title="' esc_attrsprintf__"reluare %s" ), $category->name ) ) . '">'.$category->cat_name.'</a>'.$separator;


            }


            echo 
trim($output$separator);


            }


            
?>



         <>


         


         <div class="dreapta">


         <?php empty($descarcari) ? print '0' : print $descarcari ?> Descarcari | <?php if(function_exists('the_views')) { the_views(); } ?>


         <>


         


      <>


      <h1><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>


   <div class="alignleft"><?php if ( has_post_thumbnail() ) {


the_post_thumbnail'poza-index' ); 


}
?>
<>


<?php the_content(); 




// afisam linkurile de download daca exista
$campuri 4;


$nume_document1 get_post_metaget_the_id(), 'nume-document1' ,true);
if(!empty(
$nume_document1)) {
   echo 
'<p><strong>Descarc&#259;:</strong></p>';
}
for(
$nr 1$nr<=$campuri$nr++) {
   
$nume_document get_post_metaget_the_id(), 'nume-document'.$nr ,true);
   
$link_document =  get_post_metaget_the_id(), 'link-download'.$nr ,true); 
   if(!empty(
$nume_document)) {
      echo 
'<a href="'.get_bloginfo('url').'/descarca/?id='.get_the_id().'&file='.$nr.'">'.$nume_document.'</a><br />';
   }
}




endif; 
?>



<?php if(function_exists('pf_show_link')){echo pf_show_link();} ?><br>




<?php if(function_exists('the_ratings')) { the_ratings(); } ?>




<div class="fb-comments" data-href="<?php the_permalink();?>" data-colorscheme="light" data-numposts="5" data-width="600"><>




<br>
Taguri:<?php the_tags(", "); ?><br>
<>
<!-- Links on news -->
 

Code: [Select]
<?php
/*
Template Name: Descarca Fisier
*/
$id strip_tags(htmlentities($_GET['id']));
$file strip_tags(htmlentities($_GET['file']));


if(!
is_numeric($id) || !is_numeric($file)) die();


query_posts('p='.$id);
while (
have_posts()): the_post();
  
$link get_post_metaget_the_id(), 'link-download'.$file ,true);
  if(!empty(
$link)) {
  
$descarcari get_post_metaget_the_id(), 'descarcari' ,true);
  
if(empty($descarcari)) { 
  
update_post_meta(get_the_id(), 'descarcari'1);
  
} else {
  
update_post_meta(get_the_id(), 'descarcari'$descarcari+1);
  

  
descarca_fisier($link);
  }
endwhile;
ma poate ajuta cineva sa-l repar, multumesc !
« Last Edit: July 15, 2014, 09:49:23 AM by cnusi »
Portia de Haz - atacpe.net

ArenaWeb

Problema script descarca
« on: July 15, 2014, 09:12:51 AM »

Tags: