Gå Tilbake   Webforumet.no > Utvikling og design > Innholds-kontroll > Wordpress
Registrer FAQ Medlemsliste Kalender Søk Dagens innlegg Marker forumene som lest

Wordpress Alt som har med wordpress å gjøre. Alt om plugins, themes, modifikasjoner eller andre funksjoner vedrørende Wordpress postes her.

Svar
 
Tilbakelenk Trådverktøy Søk i denne tråden Visningsmoduser
  #1 (permalink)  
Ulest 6th March 2008, 00:21
Standard   error på en blogg

Tonny Kluften sin avatar
Administrator
 
Ble medlem: Mar 2007
Sted: Horten
Innlegg: 9.955
Tonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud of

Jeg får en error på en blogg:

Parse error: syntax error, unexpected ‘/’ in /home/clickarc/public_html/wp-content/plugins/exec-php/includes/runtime.php(41) : eval()’d code on line 4

Noen idè om hvordan jeg kan løse det?
Svar med sitat
Sponsede annonser
  #2 (permalink)  
Ulest 6th March 2008, 00:24
Standard  

Medlem
 
Ble medlem: Nov 2007
Innlegg: 600
Gomlers will become famous soon enough
Send en melding på MSN til Gomlers

Kan du gi meg et utsnitt av de 5 første linjene i koden på runtime.php?
Svar med sitat
  #3 (permalink)  
Ulest 6th March 2008, 00:55
Standard  

Tonny Kluften sin avatar
Administrator
 
Ble medlem: Mar 2007
Sted: Horten
Innlegg: 9.955
Tonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud of

Så smålåten du er da. Du kan da få hele runtime.php


<?php

require_once(dirname(__FILE__).'/cache.php');
require_once(dirname(__FILE__).'/const.php');

// -----------------------------------------------------------------------------
// the ExecPhp_Runtime class handles the execution of PHP code during
// access to the articles content or widget including checks against
// the exec_php / edit_others_php capability or plugin options respectivly
// -----------------------------------------------------------------------------

if (!class_exists('ExecPhp_Runtime')) :
class ExecPhp_Runtime
{
var $m_cache = NULL;

// ---------------------------------------------------------------------------
// init
// ---------------------------------------------------------------------------

function ExecPhp_Runtime(&$cache)
{
$this->m_cache = $cache;
add_filter('the_content', array(&$this, 'filter_user_content'), 1);
add_filter('the_content_rss', array(&$this, 'filter_user_content'), 1);
add_filter('the_excerpt', array(&$this, 'filter_user_content'), 1);
add_filter('the_excerpt_rss', array(&$this, 'filter_user_content'), 1);
add_filter('widget_text', array(&$this, 'filter_widget_content'), 1);
add_filter('user_has_cap', array(&$this, 'filter_user_has_cap'), 10, 3);
}

// ---------------------------------------------------------------------------
// tools
// ---------------------------------------------------------------------------

function eval_php($content)
{
// to be compatible with older PHP4 installations
// don't use fancy ob_XXX shortcut functions
ob_start();
eval("?>$content<?php ");
$output = ob_get_contents();
ob_end_clean();
return $output;
}

// ---------------------------------------------------------------------------
// hooks
// ---------------------------------------------------------------------------

function filter_user_content($content)
{
global $post;

// check whether the article author is allowed to execute PHP code
if (!isset($post) || !isset($post->post_author))
return $content;
$poster = new WP_User($post->post_author);
if (!$poster->has_cap(ExecPhp_CAPABILITY_EXECUTE_ARTICLES))
return $content;

return $this->eval_php($content);
}

function filter_widget_content($content)
{
// check whether the admin has configured widget support
$option =& $this->m_cache->get_option();
if (!$option->get_widget_support())
return $content;

return $this->eval_php($content);
}

function filter_user_has_cap($allcaps, $caps, $args)
{
// $allcaps = Capabilities the user currently has
// $caps = Primitive capabilities being tested / requested
// $args = array with:
// $args[0] = original meta capability requested
// $args[1] = user being tested
// See code for assumptions

// This handler is only set up to deal with the edit_others_pages
// or edit_others_posts capability. Ignore all other calls into here.
$pages_request = in_array('edit_others_pages', $caps);
$posts_request = in_array('edit_others_posts', $caps);
if ((!$pages_request && !$posts_request)
|| ($pages_request && $posts_request)
|| !$args[0] || !$args[1] || $args[1] == 0)
return $allcaps;

global $post;
if (!isset($post))
return $allcaps;
$poster = new WP_User($post->post_author);
if (!$poster->has_cap(ExecPhp_CAPABILITY_EXECUTE_ARTICLES))
return $allcaps;

$editor_has_edit_others_php = (in_array(ExecPhp_CAPABILITY_EDIT_OTHERS_PHP, $allcaps)
&& $allcaps[ExecPhp_CAPABILITY_EDIT_OTHERS_PHP]);
if ($editor_has_edit_others_php)
return $allcaps;

// article may contain PHP code due to the original posters capabilities
// but the editor is not allowed to edit others PHP code, so filter out
// requested edit_others_xxx settings from the allowed caps
if ($pages_request)
unset($allcaps['edit_others_pages']);
if ($posts_request)
unset($allcaps['edit_others_posts']);
return $allcaps;
}
}
endif;

?>
Svar med sitat
  #4 (permalink)  
Ulest 6th March 2008, 01:06
Standard  

Medlem
 
Ble medlem: Nov 2007
Innlegg: 600
Gomlers will become famous soon enough
Send en melding på MSN til Gomlers

Arg.. tror nok det er en annen fil som bugger for deg. Runtime kjører jo hele driten..

Hva holdt du på å ordne når det skjedde?
(Jeg er ingen php guru, men kan da litt)
Svar med sitat
  #5 (permalink)  
Ulest 6th March 2008, 01:10
Standard  

Tonny Kluften sin avatar
Administrator
 
Ble medlem: Mar 2007
Sted: Horten
Innlegg: 9.955
Tonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud of

Jeg skal gjøre som her: Adding an eBay RSS Feed to Your Wordpress Blog

Altså, jeg skal bruke Exec-PHP og lastRSS til å vise dette:

<?php
include_once ‘./lastRSS.php’;
$rss = new lastRSS;
$rss->cache_dir = ‘./cache’; $rss->cache_time = 3600; // one hour
if ($rs = $rss->get("http://rss.api.ebay.com/ws/rssapi?FeedName=SearchResults&siteId=0&language=en-US&output=RSS20&catref=C5&sacqy=&sacur=0&from=R6&s aobfmts=exsif&dfsp=1&sacqyop=ge&saslc=0&floc=1&sab fmts=0&saprclo=&saprchi=&saaff=afcj&ftrv=1&ftrt=1& fcl=3&frpp=50&afcj=2899908&nojspr=y&satitle=Fender +Precision&afmp=&sacat=-1&saslop=1&fss=0"))
{
foreach ($rs[’items’] as $item) {
$rsscount++; if ($rsscount< 6) {
$myvar = $item[description];
$title = $item[title];
echo “<b>$title</b>$myvar”
}}
if ($rs[’items_count’] <= 0) { echo “Sorry, no items found.<br /><br />” } } else { die (’Error: RSS file not found…’); }
?>
Svar med sitat
  #6 (permalink)  
Ulest 6th March 2008, 01:14
Standard  

Feed:
Apache-junkie
 
Ble medlem: Dec 2007
Innlegg: 319
vidarlo is a jewel in the roughvidarlo is a jewel in the roughvidarlo is a jewel in the roughvidarlo is a jewel in the rough

Problemet ligger i linje 41 i runtime.php, som eval'er (altså kjører) innholdet av $content. Det er problem i linje 4 av innholdet i $content

Hiv til print_r($content); over linje 41 (som er eval("?>$content<?php ");) og paste inn det her.

Sist endret av vidarlo : 6th March 2008 kl 01:14. Årsak: smilies + php + paranteser = FUGLY
Svar med sitat
  #7 (permalink)  
Ulest 6th March 2008, 01:16
Standard  

Medlem
 
Ble medlem: Nov 2007
Innlegg: 600
Gomlers will become famous soon enough
Send en melding på MSN til Gomlers

hehe.. det er nå jeg tenker at jeg burde lære meg til å holde kjeft, og ikke briefe med kunnskaper jeg egentlig ikke har

For å være fullstendig ærlig med deg, håpet jeg på at du skulle komme med en eller annen snutt som det her:

Sitat:
include_once'.//lastRSS.php';
så kunne jeg elegant si at du skulle ta bort den ene skråstreken..

Jeg hadde selvfølgelig ikke ventet noe sånn vanskelig greier som du serverer meg med nå..
Sorry brukernavn, jeg må passe denne videre til noen andre...
Svar med sitat
  #8 (permalink)  
Ulest 6th March 2008, 01:19
Standard  

Tonny Kluften sin avatar
Administrator
 
Ble medlem: Mar 2007
Sted: Horten
Innlegg: 9.955
Tonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud of

vidarlo, får fortsatt error. Se Click Archives

Nå vises:

include_once ‘./lastRSS.php’;
$rss = new lastRSS;
$rss->cache_dir = ‘./cache’; $rss->cache_time = 3600; // one hour
if ($rs = $rss->get(”<![CDATA[Fender Precision]]>))
{
foreach ($rs[’items’] as $item) {
$rsscount++; if ($rsscount< 6) {
$myvar = $item[description];
$title = $item[title];
echo “$title$myvar”
}}
if ($rs[’items_count’] <= 0) { echo “Sorry, no items found.

” } } else { die (’Error: RSS file not found…’); }
?>

Parse error: syntax error, unexpected ‘/’ in /home/clickarc/public_html/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 2
Svar med sitat
  #9 (permalink)  
Ulest 6th March 2008, 01:19
Standard  

Medlem
 
Ble medlem: Nov 2007
Innlegg: 600
Gomlers will become famous soon enough
Send en melding på MSN til Gomlers

AHA... kanskje du kan prøve dette her:
Bytt ut " med ' på denne:

Sitat:
"http://rss.api.ebay.com/ws/rssapi?FeedName=S earchResults&siteId=0&language=en-US&output=RSS20&catref=C5&sacqy=&sacur=0&from=R6& s aobfmts=exsif&dfsp=1&sacqyop=ge&saslc=0&floc=1&sab fmts=0&saprclo=&saprchi=&saaff=afcj&ftrv=1&ftrt=1& fcl=3&frpp=50&afcj=2899908&nojspr=y&satitle=Fender +Precision&afmp=&sacat=-1&saslop=1&fss=0"
Altså enkle ' ' og ikke doble rundt taggen din.. prøv det.
Svar med sitat
  #10 (permalink)  
Ulest 6th March 2008, 01:21
Standard  

Tonny Kluften sin avatar
Administrator
 
Ble medlem: Mar 2007
Sted: Horten
Innlegg: 9.955
Tonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud of

Har prøvd det allerede Gomlers, uten lykke.
Svar med sitat
  #11 (permalink)  
Ulest 6th March 2008, 01:22
Standard  

Medlem
 
Ble medlem: Nov 2007
Innlegg: 600
Gomlers will become famous soon enough
Send en melding på MSN til Gomlers

Nope, hjalp ikke ser jeg...!?
Svar med sitat
  #12 (permalink)  
Ulest 6th March 2008, 01:22
Standard  

Medlem
 
Ble medlem: Nov 2007
Innlegg: 600
Gomlers will become famous soon enough
Send en melding på MSN til Gomlers

Da lar vi vidarlo ta fortsettelsen
Lykke til uansett..
Svar med sitat
  #13 (permalink)  
Ulest 6th March 2008, 02:00
Standard  

Feed:
Apache-junkie
 
Ble medlem: Dec 2007
Innlegg: 319
vidarlo is a jewel in the roughvidarlo is a jewel in the roughvidarlo is a jewel in the roughvidarlo is a jewel in the rough

Eg har funne et par hint i en kommentar på php.net...
PHP: eval - Manual

Usikker på om eval støtter objekter, eller includes. Et godt stalltips er å lagre det du prøver å eval'e i ei ega php-fil, og gi php-saken i wordpress beskjed om å include()'e den fila istadenfor å eval'e heile saken, om du forstår kva eg meiner.
Svar med sitat
  #14 (permalink)  
Ulest 6th March 2008, 02:07
Standard  

Tonny Kluften sin avatar
Administrator
 
Ble medlem: Mar 2007
Sted: Horten
Innlegg: 9.955
Tonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud ofTonny Kluften has much to be proud of

Har ikke peiling på hva du snakker om desverre. Jeg kan ikke slikt. Dette skulle liksom virke slik uten noe mere fiksfakserier:

Adding an eBay RSS Feed to Your Wordpress Blog

Og det som står nederst om at "Some webhosting places have fopen(); turned off for “security” reasons" gjelder ikke meg, det er "on" på min server.


Uansett takk for hjepa, jeg tror jeg prøver et annet script.

Sist endret av Tonny Kluften : 6th March 2008 kl 02:32.
Svar med sitat
Svar


Trådverktøy Søk i denne tråden
Søk i denne tråden:

Avansert søk
Visningsmoduser


Lignende tråder
Tråd Tråd startet av Forum Svar Siste innlegg
XML error: Mismatched tag at line 86 - This appears to be an HTML webpage, not a feed Tonny Kluften Ris og ros til WF 6 2nd September 2009 15:28
Wp blogg onlyme Webutvikling 11 20th April 2009 16:05
Fatal error? Hvorfor? Mr Vest Webutvikling 4 16th April 2009 11:43
Min nye blogg Bjrl Blogging 15 22nd January 2009 07:55
mPayX - får bare error? TorsteinO Webutvikling 26 1st January 2008 05:53

Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO

Webforumet.no utvikles av tonny.no | qts.no hjemmeside | Sponset av Mine matoppskrifter