Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP]Parse error: syntax error, unexpected T_STRING in on line 41
Forum PHP.pl > Forum > Przedszkole
pokemon1980
Witam,
na mojej stronie pojawił się taki błąd :
Parse error: syntax error, unexpected T_STRING in /(...)/ski.wp.customizer.php on line 41

Line 41 zaczyna się tu : trait cz_supplement


Przeszukam kilka razy ten kod w celu znalezienia tego błędu ale bez skutecznie. jest szansa aby ktoś mi pomógł?

Będę wdzięczna za wszelką pomoc.
Pozdrawiam,



CODE
add_action( 'customize_controls_enqueue_scripts', 'ski\cz_enqueue' );

/**
* Defining a trait here means that we can continue to derive from the existing
* WP controls, but add in our additional attributes without changing the signature.
*
* @author Dan Suleski
* @since 2.0
*/
trait cz_supplement
{
/**
* @var string Optional description to be displayed near the option title
*/
public $desc = '';

/**
* @var string Optional description to be displayed after the main control
*/
public $desc_after = '';

/**
* The label should be uniform for every control - so just lay it out
* once and reference it from the render_content callback everywhere.
*/
public function get_label_markup()
{
if ( empty( $this->label ) ) return '';
return
'<p class="customize-control-title">'.$this->label.'</p>';
}

/**
* The description should be uniform for every control - so just lay it out
* once and reference it from the render_content callback everywhere.
*/
public function get_description_markup()
{
if ( empty( $this->desc ) ) return '';
return
'<p class="cc-description">'.$this->desc.'</p>';
}

/**
* Just like the description that comes first, the description that comes after
* the main control should be uniform for each of these controls - so just lay
* it out once and reference it from the render_content callback everywhere.
*/
public function get_description_after_markup()
{
if ( empty( $this->desc_after ) ) return '';
return
'<p class="cc-description-after">'.$this->desc_after.'</p>';
}

/**
* The label and description should be uniform for every control - so just lay it out
* once and reference it from the render_content callback everywhere.
*/
public function get_label_description_markup()
{
return
$this->get_label_markup();
$this->get_description_markup();
}


viking
Jaka wersja PHP?
nospor
trait wymaga PHP 5.4.0 lub nowszego
pokemon1980
Przepraszam za głupie pytanie ale gdzie mogę znaleźć wersje php?

chyba mam 5.2.2
pokemon1980
w pliku xmlrpc.php znalazłam taką informacje :
CODE
<?php
/**
* XML-RPC protocol support for WordPress
*
* @package WordPress
*/

/**
* Whether this is an XML-RPC Request
*
* @var bool
*/
define('XMLRPC_REQUEST', true);

// Some browser-embedded clients send cookies. We don't want them.
$_COOKIE = array();

// A bug in PHP < 5.2.2 makes $HTTP_RAW_POST_DATA not set by default,
// but we can do it ourself.
if ( !isset( $HTTP_RAW_POST_DATA ) ) {
$HTTP_RAW_POST_DATA = file_get_contents( 'php://input' );
}

// fix for mozBlog and other cases where '<?xml' isn't on the very first line
if ( isset($HTTP_RAW_POST_DATA) )
$HTTP_RAW_POST_DATA = trim($HTTP_RAW_POST_DATA);


więc chyba mam wersje 5.2.2
Pyton_000
facepalmxd.gif blink.gif sciana.gif dry.gif
pokemon1980
Najłatwiej wyśmiać gorzej pomóc.
nospor
Dostales pomoc. Musisz miec php 5.4 lub nowsze.
Zas jakis komentarz przy jakis pluginie nie oznacza jaka masz wersje php.... By sprawdzic jaką masz wersje php juz ci napisano czego masz uzyc: phpinfo() lub phpversion()
Zamiast wiec narzekac, poprostu sprawdź normalnie jak ci napisano.
pokemon1980
po zmianie wersji na wyższa 5.5.5 pojawił się inny komunikat

Warning: mysql_real_escape_string(): Access denied for user 'xxx'@'xxx' (using password: NO) in /..../statpress.php on line 1191

Warning: mysql_real_escape_string(): A link to the server could not be established in /..../statpress.php statpress.php on line 1191

Warning: mysql_real_escape_string(): Access denied for user 'xxx'@'xxx' (using password: NO) in /..../statpress.php/statpress.php on line 1194

Warning: mysql_real_escape_string(): A link to the server could not be established in /..../statpress.php /statpress.php on line 1194

Warning: mysql_real_escape_string(): Access denied for user 'xxx'@'xxx' (using password: NO) in /..../statpress.php/statpress.php on line 1197

Warning: mysql_real_escape_string(): A link to the server could not be established in /..../statpress.php statpress.php on line 1197

Line 1191 zaczyna się od $urlRequested=mysql_real_escape_string($urlRequested);

możecie z tym mi pomóc?

CODE
// URL (requested)
$urlRequested=iri_StatPress_URL();
if (eregi(".ico$", $urlRequested)) { return ''; }
if (eregi("favicon.ico", $urlRequested)) { return ''; }
if (eregi(".css$", $urlRequested)) { return ''; }
if (eregi(".js$", $urlRequested)) { return ''; }
if (stristr($urlRequested,"/wp-content/plugins") != FALSE) { return ''; }
if (stristr($urlRequested,"/wp-content/themes") != FALSE) { return ''; }
if (stristr($urlRequested,"/wp-admin/") != FALSE) { return ''; }
$urlRequested=mysql_real_escape_string($urlRequested);

$referrer = (isset($_SERVER['HTTP_REFERER']) ? htmlentities($_SERVER['HTTP_REFERER']) : '');
$referrer=mysql_real_escape_string($referrer);

$userAgent = (isset($_SERVER['HTTP_USER_AGENT']) ? htmlentities($_SERVER['HTTP_USER_AGENT']) : '');
$userAgent=mysql_real_escape_string($userAgent);

$spider=iriGetSpider($userAgent);

if(($spider != '') and (get_option('statpress_donotcollectspider')=='checked')) { return ''; }

if($spider != '') {
$os=''; $browser='';
} else {
// Trap feeds
$feed=iri_StatPress_is_feed(get_bloginfo('url').$_SERVER['REQUEST_URI']);
// Get OS and browser
$os=iriGetOS($userAgent);
$browser=iriGetBrowser($userAgent);
list($searchengine,$search_phrase)=explode("|",iriGetSE($referrer));
}
// Country (ip2nation table) or language
$countrylang="";
if($wpdb->get_var("SHOW TABLES LIKE 'ip2nation'") == 'ip2nation') {
$sql='SELECT * FROM ip2nation WHERE ip < INET_ATON("'.$ipAddress.'") ORDER BY ip DESC LIMIT 0,1';
$qry = $wpdb->get_row($sql);
$countrylang=$qry->country;
}
if($countrylang == '') {
$countrylang=iriGetLanguage($_SERVER['HTTP_ACCEPT_LANGUAGE']);
}
// Auto-delete visits if...
if(get_option('statpress_autodelete') != '') {
$t=gmdate("Ymd",strtotime('-'.get_option('statpress_autodelete')));
$results = $wpdb->query( "DELETE FROM " . $table_name . " WHERE date < '" . $t . "'");
}
if ((!is_user_logged_in()) OR (get_option('statpress_collectloggeduser')=='checked')) {
if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) {
iri_StatPress_CreateTable();
}
$insert = "INSERT INTO " . $table_name .
" (date, time, ip, urlrequested, agent, referrer, search,nation,os,browser,searchengine,spider,feed,user,timestamp) " .
"VALUES ('$vdate','$vtime','$ipAddress','$urlRequested','".addslashes(strip_tags($userAgent))."','$referrer','" .
addslashes(strip_tags($search_phrase))."','".$countrylang."','$os','$browser','$searchengine','$spider','$feed','$userdata->user_login','$timestamp')";
$results = $wpdb->query( $insert );
}
}


function iriStatPressUpdate() {
global $wpdb;
$table_name = $wpdb->prefix . "statpress";

$wpdb->show_errors();

print "<div class='wrap'><table class='widefat'><thead><tr><th scope='col'><h2>".__('Updating...','statpress')."</h2></th><th scope='col' style='width:150px;'>".__('Size','statpress')."</th><th scope='col' style='width:100px;'>".__('Result','statpress')."</th><th></th></tr></thead>";
print "<tbody id='the-list'>";

# check if ip2nation .sql file exists
if(file_exists(ABSPATH.'wp-content/plugins/'.dirname(plugin_basename(__FILE__)).'/ip2nation.sql')) {
print "<tr><td>ip2nation.sql</td>";
$FP = fopen (ABSPATH.'wp-content/plugins/'.dirname(plugin_basename(__FILE__)).'/ip2nation.sql', 'r' );
$READ = fread ( $FP, filesize (ABSPATH.'wp-content/plugins/'.dirname(plugin_basename(__FILE__)).'/ip2nation.sql') );
$READ = explode ( ";\n", $READ );
foreach ( $READ as $RED ) {
if($RES != '') { $wpdb->query($RED); }
}
print "<td>".iritablesize("ip2nation")."</td>";
print "<td><IMG style='border:0px;width:20px;height:20px;' SRC='/wp-content/plugins/".dirname(plugin_basename(__FILE__))."/images/ok.gif'></td></tr>";
}
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.