[HELP] problemi con sito php

Only PHP & MySQL.

Moderator: DaD

[HELP] problemi con sito php

Postby MasterStudioDesign on 05 Jul 2008 15:37

il sito in questione è www.trest.altervista.org


ho messo sul server tutti i file.. ma la pagina iniziale rimane bianca....

come posso risolvere?


questo è il sorgente dell'index
Code: Select all
<?php
ob_start();
error_reporting(0);
session_start();
$_SESSION['user_logged'] = false;

require_once('config.php');


$smarty->display('head.tpl');

$smarty->display('head_menu.tpl');
$smarty->display('search_form.tpl');

require_once('app-modules.php');

?>


</div>
<?php $smarty->display('footer.tpl'); ?>





e il file config.php è strutturato così
Code: Select all
<?php
require('app-load.php');


$smarty->debugging = false;   // debugging false = off, true = on
$smarty->caching = false;    // caching = false = off, true = on
$smarty->assign('lang', $lang);

class configuration {

function cfg() {
   $cfg = array(
   'img_dir' => 'public/title_images/',
   'site_url' => 'http://www.mysite.com/',
);

return $cfg;

}


}

$cfg = new configuration;

$smarty->assign('cfg', $cfg->cfg());

if(empty($_GET['slowo']) && empty($_GET['akcja'])) {

$smarty->assign('title', 'KatalogMP3.eu');

} else {

$smarty->assign('title', $f->dynamic_title($_GET['slowo']));

}

if($_GET['aplikacja'] == "price" || $_GET['aplikacja'] == "auctions" && $_GET['aplikacja'] == "lyrics") {

$smarty->assign('title', 'KatalogMP3.eu'); // default site title

}

if($_GET['akcja'] == "show" && $_GET['aplikacja'] == "mp3") {

$mp3_info = $wrzuta->get_file_info($_GET['mp3_id']);
$title = $mp3_info['title'];

$title .= ' MP3 ' . $lang['listen_and_download'];

$smarty->assign('title', $title);

}

if($_GET['akcja'] == "show" && $_GET['aplikacja'] == "video") {

$info = $youtube->get_link($_GET['video_id']);
$title = $info['title'];

$title .= ' Video ' . $lang['watch_and_download'];

$smarty->assign('title', $title);

}

?>



come risolvo... ?


Confido in voi...
MasterStudioDesign
Variabile
 
Posts: 279
Joined: 10 Jun 2006 14:48
Location: Roma

[HELP] problemi con sito php

Sponsor

Google Adsense

Re: [HELP] problemi con sito php

Postby k8 on 05 Jul 2008 16:02

Inizia a modificare quel
Code: Select all
error_reporting(0);

con
Code: Select all
error_reporting(E_ALL);


e dicci che errori ti mostra la pagina :)
Free hosting.
Whois
Cerco gente interessata, bloggers,moderatori,programmatori & o scripter per far rinascere il progetto bigbug.
Topic di riferimento: http://forum.big-bug.net/news-dal-web-f7/apertura-nuovo-sito-t1798.html
User avatar
k8
Admin
 
Posts: 2022
Joined: 06 Jun 2006 16:00

Re: [HELP] problemi con sito php

Postby MasterStudioDesign on 06 Jul 2008 10:40

ecco i seguenti erroi che mi da..

visibili anke sul link seguente http://trest.altervista.org/

Code: Select all
Notice: A session had already been started - ignoring session_start() in /membri/trest/app-load.php on line 2

Notice: Undefined index: lang in /membri/trest/app-load.php on line 6

Notice: Undefined index: lang in /membri/trest/app-load.php on line 9

Notice: Undefined index: lang in /membri/trest/app-load.php on line 12

Notice: Undefined index: lang in /membri/trest/app-load.php on line 15

Notice: Undefined index: lang in /membri/trest/app-load.php on line 18

Notice: Undefined index: lang in /membri/trest/app-load.php on line 21

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /membri/trest/class/youtube.class.php on line 21



Can you help me..? :sad:
MasterStudioDesign
Variabile
 
Posts: 279
Joined: 10 Jun 2006 14:48
Location: Roma

Re: [HELP] problemi con sito php

Postby k8 on 06 Jul 2008 14:22

Puoi postare il file youtube.class.php?
Free hosting.
Whois
Cerco gente interessata, bloggers,moderatori,programmatori & o scripter per far rinascere il progetto bigbug.
Topic di riferimento: http://forum.big-bug.net/news-dal-web-f7/apertura-nuovo-sito-t1798.html
User avatar
k8
Admin
 
Posts: 2022
Joined: 06 Jun 2006 16:00

Re: [HELP] problemi con sito php

Postby MasterStudioDesign on 06 Jul 2008 20:23

Questi è il file youtube.class.php

Code: Select all
<?php
/* =============================================================================
* Copyright 2005-08 ©
* la
*
* la
*
* la
*
* la
*
* la
* =============================================================================
*/
define('API_KEY', 'ARgbYoNTCbs');
define('API_URL', 'http://www.youtube.com/');
define('API_REST_CALL', API_URL . 'api2_rest?');
define('API_XMLRPC_CALL', API_URL . 'api2_xmlrpc?');
define('BY_TAG', 'list_by_tag');
class youtube {
   public $xml, $config = array(), $api_call, $return, $tag, $errors;
   public function __construct($api_key = API_KEY, $page = 1, $per_page = 25) {
      youtube::set('api_key', API_KEY);
      youtube::set('page', $page);
      youtube::set('per_page', $per_page);
      youtube::modify_call(API_REST_CALL . 'method=youtube.');
   }

   function xml_to_array($xml) {
      $fils = 0;
      $tab = false;
      $array = array();

      foreach($xml->children() as $key => $value) {
         $child = youtube::xml_to_array($value);

         //To deal with the attributes
         //foreach ($node->attributes() as $ak => $av) {
         //   $child[$ak] = (string)$av;
         //}
         //Let see if the new child is not in the array
         if ($tab == false && in_array($key, array_keys($array))) {
            //If this element is already in the array we will create an indexed array
            $tmp = $array[$key];
            $array[$key] = NULL;
            $array[$key][] = $tmp;
            $array[$key][] = $child;
            $tab = true;
         } elseif($tab == true) {
            //Add an element in an existing array
            $array[$key][] = $child;
         } else {
            //Add a simple element
            $array[$key] = $child;
         }
         $fils++;
      }

      if($fils==0) {
         return (string)$xml;
      }
      return $array;
   }

   // SET A CONFIG VARIABLE
   public function set($item, $value) {
      $this->config[$item] = $value;
   }

   // ACCESS CONFIG
   public function config($item) {
      return $this->config[$item];
   }

   // MODIFY THE CALL CLASS PROPERTY
   public function modify_call($params) {
      $this->api_call .= $params;
   }

   // ECHO THE CALL FOR DEBUGGING
   public function return_call() {
      return $this->api_call;
   }

   // YOUTUBE VIDEO METHODS
   public function videos($data = '', $method = BY_TAG) {
      //---------------------------------------------//
      $this->api_call .= 'videos.'; ///////////////////////
      //---------------------------------------------//
      switch ($method) {
         case BY_TAG:
            if (isset($_GET['video'])) {
               $_GET['video'] = str_replace(' ', '+', $_GET['video']);
               $this->tag = '&tag=' . $_GET['video'];
            } else {
               $this->tag = '&tag='. $data;
            }
            youtube::modify_call($method . '&dev_id=' . $this->config['api_key'] . $this->tag);
            break;

         default:
            return 'Tags.';
            break;
      }

      // CALL DISPLAY
      return youtube::display();
   }

   public function tags_for_video($tags) {
      $tag_links = '';

      // explode
      $x = explode(' ', $tags);
      if (count($x) > 0) {
         foreach ($x as $k => $v) {
            $tag_links .= "<a href=\"{$_SERVER['PHP_SELF']}?tag=$v\">$v</a> ";
         }
      } else {
         $tag_links = "<a href=\"{$_SERVER['PHP_SELF']}?tag=mutemath\">mutemath</a>";
      }
      return $tag_links;
   }

   // DISPLAY RESULTS
   public function display() {
      // CHECK FOR A NEW PAGE & PER PAGE
      if (isset($_GET['page'])) {
         youtube::set('page', $_GET['page']);
      }
      if (isset($_GET['per_page'])) {
         youtube::set('per_page', $_GET['per_page']);
      }

      // per page, page, prev, next
      // total videos, total pages
      youtube::modify_call('&page=' . youtube::config('page') . '&per_page=' . youtube::config('per_page'));

      // SEND REQUEST
      $this->return = file_get_contents(youtube::return_call());
      $this->xml = new SimpleXMLElement($this->return);
      $this->xml = youtube::xml_to_array($this->xml);

      // CHECK IF THEY'RE ASKING FOR A VIDEO ID
      if (isset($_GET['video_id'])) {
         define('YOUTUBE_VIDEO_ID', $_GET['video_id']);
         
         // loop through videos to get videos index
         foreach ($this->xml['video_list']['video'] as $indx => $array) {
            if ($array['id'] == $_GET['video_id']) {
               $index = $indx;
               echo $index;
               break;
            } else {
               $index = '';
            }
         }

         // define index
         define('YOUTUBE_VIDEO_INDEX', $index);
      } else {
         define('YOUTUBE_VIDEO_ID', $this->xml['video_list']['video'][0]['id']);
         define('YOUTUBE_VIDEO_INDEX', 0);
      }

      //////////////////////////////////////////
      // CREATE DISPLAY CONSTANTS //
      /////////////////////////////////////////
      define('YOUTUBE_PAGE', youtube::config('page'));
      define('YOUTUBE_PER_PAGE', youtube::config('per_page'));
      $prev = (youtube::config('page') - 1 == 0) ? 1 : youtube::config('page') - 1;
      define('YOUTUBE_PREV_PAGE', $prev . $this->tag);
      define('YOUTUBE_NEXT_PAGE', youtube::config('page') + 1 . $this->tag);
      define('YOUTUBE_TOTAL_VIDEOS', $this->xml['video_list']['total']);
      define('YOUTUBE_TOTAL_PAGES', ceil($this->xml['video_list']['total'] / youtube::config('per_page')));

      // CONVERT FROM SIMPLEXML OBJECT TO ARRAY
      return $this->xml;
   }
}

class video {

function wyniki($query, $p) {
$api = new youtube();
$api->set('per_page', 16);
$api->set('page', $p);
$res = $api->videos(urlencode($query));
$video_list = $res['video_list']['video'];
require_once('class/functions.class.php');
$f = new functions;

   foreach ($video_list as $k => $v) {
   $this->wynik[] = array(
   'title' => $v['title'],
   'id' => $v['id'],
   'thumb' => $v['thumbnail_url'],
   'desc' => $v['description'],
   'author' => $v['author'],
   'tags' => $v['tags'],
   'rating' => $v['rating_avg'],
   'views' => $v['view_count'],
   'time' => $v['length_seconds'],
   'link' => $f->usun_znaki($v['title']),
);
}

return $this->wynik;

}

      function get_link($id) {
         if($_SESSION['language'] == "pl") {
         $langz = 'pl.';
      }
      else {
      $langz = '';
      }
         $youtube_video_id = $id;
         $open = file_get_contents('http://'.$langz.'youtube.com/watch?v='.$youtube_video_id.'');
         preg_match_all('/"video_id": "(.*)", "l": (.*), "sk": "(.*)"/', $open, $id); // get video id
         preg_match_all('/"l": (.*), "sk": "(.*)"/', $open, $le); // get "l" var
         preg_match_all('/"t": "(.*)", "(.*)": "(.*)", "(.*)": "(.*)"/ismU', $open, $te); // get "t" vars
         preg_match_all('#<title>YouTube - (.*)<\/title>#ismU', $open, $this->title);
         preg_match_all('#<td>(.*): <span class="watch-stat">(.*)<\/span><\/td>#ismU', $open, $this->stats);
         preg_match_all('#<div  class="watch-video-desc">\s+<span >(.*)<\/span>\s+<\/div>#ismU', $open, $this->desc);
         $this->desc = $this->desc[1][0];
         $this->stats = $this->stats[2][0];
         $this->title = $this->title[1][0];
         $this->t = $te[1][0];
         $this->return = array('t' => $this->t, 'title' => $this->title, 'added' => $this->stats, 'desc' => $this->desc, 'id' => $this->id);
         return $this->return;
   }


function records_count($q) {

$this->q = urlencode($q);
$this->url = 'http://youtube.com/results?search_query='.$this->q;
$this->content = file_get_contents($this->url);

preg_match_all('#of about <strong>(.*)</strong>#ismU', $this->content, $this->results);

$this->results = $this->results[1][0];

$this->results = str_replace(',', '', $this->results);

return $this->results;

}

}
?>
MasterStudioDesign
Variabile
 
Posts: 279
Joined: 10 Jun 2006 14:48
Location: Roma

Re: [HELP] problemi con sito php

Postby k8 on 06 Jul 2008 20:49

Inizia a metter intanto al posto di

Code: Select all
error_reporting(E_ALL);


Code: Select all
error_reporting(E_ALL ^ E_NOTICE);

Così tutti i notice dovrebbero sparire :P

Comunque per quanto riguarda gli errori mmm
la riga 21 è questa public $xml, $config = array(), $api_call, $return, $tag, $errors; giusto?
io non vedo errori..
Free hosting.
Whois
Cerco gente interessata, bloggers,moderatori,programmatori & o scripter per far rinascere il progetto bigbug.
Topic di riferimento: http://forum.big-bug.net/news-dal-web-f7/apertura-nuovo-sito-t1798.html
User avatar
k8
Admin
 
Posts: 2022
Joined: 06 Jun 2006 16:00

Re: [HELP] problemi con sito php

Postby MasterStudioDesign on 07 Jul 2008 11:38

idem... come ne posso venire a capo da questo problema?
MasterStudioDesign
Variabile
 
Posts: 279
Joined: 10 Jun 2006 14:48
Location: Roma

Re: [HELP] problemi con sito php

Postby k8 on 07 Jul 2008 12:44

MasterStudioDesign wrote:idem... come ne posso venire a capo da questo problema?


non ce ne sono di errori, anche perchè facendo
Code: Select all
macbook:prove duccio$ php youtube.php
macbook:prove duccio$

non ne risultano..

secondo me hai copi-incollato male, prova a postare tutto l'archivio tramite l'upload attachment del forum..
Free hosting.
Whois
Cerco gente interessata, bloggers,moderatori,programmatori & o scripter per far rinascere il progetto bigbug.
Topic di riferimento: http://forum.big-bug.net/news-dal-web-f7/apertura-nuovo-sito-t1798.html
User avatar
k8
Admin
 
Posts: 2022
Joined: 06 Jun 2006 16:00

Re: [HELP] problemi con sito php

Postby MasterStudioDesign on 07 Jul 2008 15:51

è tutto giusto... non riesco a capire...
MasterStudioDesign
Variabile
 
Posts: 279
Joined: 10 Jun 2006 14:48
Location: Roma

Re: [HELP] problemi con sito php

Postby k8 on 07 Jul 2008 15:55

k8 wrote:secondo me hai copi-incollato male, prova a postare tutto l'archivio tramite l'upload attachment del forum..

naturalmente se vuo ricevere supporto ;)
Free hosting.
Whois
Cerco gente interessata, bloggers,moderatori,programmatori & o scripter per far rinascere il progetto bigbug.
Topic di riferimento: http://forum.big-bug.net/news-dal-web-f7/apertura-nuovo-sito-t1798.html
User avatar
k8
Admin
 
Posts: 2022
Joined: 06 Jun 2006 16:00

Re: [HELP] problemi con sito php

Postby MasterStudioDesign on 07 Jul 2008 16:02

Code: Select all
Notice: A session had already been started - ignoring session_start() in /membri/trest/app-load.php on line 2


Vuoldire che ci sono 2 sessioni da quanto ho capito... e se io vado a togliere l'altra mi dice

Code: Select all
Fatal error: Call to undefined method: stdClass->assign() in /membri/trest/config.php on line 7
MasterStudioDesign
Variabile
 
Posts: 279
Joined: 10 Jun 2006 14:48
Location: Roma

Re: [HELP] problemi con sito php

Postby MasterStudioDesign on 07 Jul 2008 16:09

questo è parte del file config.php

Code: Select all
<?php
require('app-load.php');


$smarty->debugging = false;   // debugging false = off, true = on
$smarty->caching = false;    // caching = false = off, true = on
$smarty->assign('lang', $lang);

class configuration {
MasterStudioDesign
Variabile
 
Posts: 279
Joined: 10 Jun 2006 14:48
Location: Roma

Re: [HELP] problemi con sito php

Postby k8 on 07 Jul 2008 16:26

??? e gli errori di prima?
prima ti dava altri errori, ma vuoi postare l'archivio o no ?
Free hosting.
Whois
Cerco gente interessata, bloggers,moderatori,programmatori & o scripter per far rinascere il progetto bigbug.
Topic di riferimento: http://forum.big-bug.net/news-dal-web-f7/apertura-nuovo-sito-t1798.html
User avatar
k8
Admin
 
Posts: 2022
Joined: 06 Jun 2006 16:00

Re: [HELP] problemi con sito php

Postby MasterStudioDesign on 07 Jul 2008 16:31

non posso postare gli archivi per un fatto di ©
MasterStudioDesign
Variabile
 
Posts: 279
Joined: 10 Jun 2006 14:48
Location: Roma

Re: [HELP] problemi con sito php

Postby k8 on 07 Jul 2008 16:57

copyright? :o
è la stessa giusto?
http://www.anwmp.org/node/1295
quale copyright? :D
magari posta il file app-load ...
Free hosting.
Whois
Cerco gente interessata, bloggers,moderatori,programmatori & o scripter per far rinascere il progetto bigbug.
Topic di riferimento: http://forum.big-bug.net/news-dal-web-f7/apertura-nuovo-sito-t1798.html
User avatar
k8
Admin
 
Posts: 2022
Joined: 06 Jun 2006 16:00

Next

Return to PHP & MySQL

Who is online

Users browsing this forum: No registered users and 1 guest

cron