[PHP] Parse error: syntax error, unexpected T_STRING

Pagina: 1
Acties:
  • 952 views

Acties:
  • 0 Henk 'm!

  • YoshiBignose
  • Registratie: April 2004
  • Laatst online: 12-09 14:51
Ik krijg de volgende error Parse error: syntax error, unexpected T_STRING in /home/blabla/public_html/modules/news.php on line 4

Het vreemde is dat het altijd gewoon gewerkt heeft. Het desbetreffende php bestand is trouwens niet eens groot, maar ik zie niet wat er fout gaat...

code:
1
2
3
4
5
6
7
8
9
10
11
12
<?

    $weblog = 0;

    $execute_filename = 'news.php';

    $layout_filename = 'news.php';

    
    include('index.php');

?>


Zou het te maken hebben met een upgrade naar een andere PHP versie van de server ofzo??

Facts don't care about your feelings


Acties:
  • 0 Henk 'm!

  • Soultaker
  • Registratie: September 2000
  • Laatst online: 00:02
Ik geloof er niets van dat dit de relevante code is aangezien regel 4 leeg is, en je een foutmelding krijgt in modules/news.php terwijl deze code dat bestand pas als template instelt (en waarom zou dat gebeuren als modules/news.php al geladen is?)

Ga dus eerst maar eens de relevante code opzoeken.

Acties:
  • 0 Henk 'm!

  • YoshiBignose
  • Registratie: April 2004
  • Laatst online: 12-09 14:51
Oooh sorry je hebt gelijk.... in de modules map moet ik zijn. De eerste paar regels van news.php:

code:
1
2
3
4
5
6
7
8
9
<?      $pagekey = 'news';  $prefix = 'news.';      $this_page['menuitem'] = get_string('menu.' . $pagekey, 'setting', 'numeric');  $this_page[$pagekey] = array();         // Algemene waarden     $nid = get_string('nid', 'get', 'numeric');     $cid = get_string('cid', 'get', 'numeric');     $tid = get_string('tid', 'get', 'numeric');     $dossier = get_string('dossier', 'get', 'numeric');     $member = get_string('member', 'get', 'numeric');       // Weblogfunctie    if (!isset($weblog)) $weblog = get_string('weblog', 'get', 'numeric');  if ($weblog <> 1) $weblog = 0;      $limit = (get_string('limit', 'get', 'numeric') > 0) ? get_string('limit', 'get', 'numeric') :                      ((get_string(($weblog == 1 ? 'weblog.' : $prefix) . 'limit', 'setting', 'numeric') > 0) ? get_string(($weblog == 1 ? 'weblog.' : $prefix) . 'limit', 'setting', 'numeric') : 15);   // Paginanummer altijd corrigeren   $page = get_string('page', 'get', 'numeric');   if ($page < 0) $page = 0;       // Previewfunctie   $preview = get_string('preview', 'get', 'numeric');     if ($preview <> 1) $preview = 0;        if ($nid > 0) {             // Artikel weergeven        $article = get_article($nid);       if ($article === false) {                   // Geen artikel aangetroffen            $this_page[$pagekey]['error'] = 'no_article';           $this_page[$pagekey]['show'] = 'error';         } elseif ($article['rights']['right_read'] || ($article['rights']['right_preview'] && $preview == 1)) {             // Artikel weergeven            $this_page[$pagekey]['article'] = &$article;            if (!isset($_SESSION["news$nid"]) && $user['google'] == 0 && $user['rank'] != $mod_rank && $user['id'] != $article['member_id']) {                  // Unieke bezoeker tellen               $article['article_hits'] ++;                query("UPDATE NewsArticles                           SET Hits = Hits + 1                             WHERE Id = $nid");                 $_SESSION["news$nid"] = 0;          } elseif ($user['google'] == 1 && $article['article_google'] == 0) {                                // Google heeft deze pagina gearchiveerd                $article['article_google'] = 1;                 query("UPDATE NewsArticles                           SET Google = 1                              WHERE Id = $nid");             }           if (!$article['rights']['right_hits']) $article['article_hits'] = 0;                if ($article['article_replies'] == 1 && action != '' && $preview == 0) {                            // Reactiefuncties uitvoeren en/of weergeven                $forumid = 0;               $topicid = $article['reply_id'];                $replyid = get_string('reply', 'get', 'numeric');               $moveto = 0;                $citeid = get_string('cite', 'get', 'numeric');                 // Forumfuncties uitvoeren              $action = strtolower(get_string('action', 'get', 'string'));                if ($action == 'new') $action = 'reply';                $action = ($action == 'reply' && $topicid == 0) ? 'new' : ((!in_array($action, array('new', 'reply', 'modify', 'delete'))) ? '' : $action);                                 if ($action == 'new') {                                     // Eerste reactie                   $_POST['title'] = strtoupper($pagekey) . ': ' . $article['article_title'];                  forum_topic_action($host . 'news.php?nid=' . $nid);                     // Kijken of er nu een nieuw onderwerp is aangemaakt, zo ja, opslaan                    if ($topicid > 0) {                         query("UPDATE NewsArticles                                   SET Topic          = $topicid                                       , ReplyCount = 1                                    WHERE Id = $nid");                     }               } elseif ($action != '') {                                  // Overige reacties                     if ($action == 'delete') $topicid = 0;                  forum_topic_action($host . 'news.php?nid=' . $nid);                     // Reactieteller bijwerken                  $forum = get_replies($article['reply_id'], false, true);                    if ($forum === false) {                         query("UPDATE NewsArticles                                   SET ReplyCount = 0                                          , Topic            = 0                                      WHERE Id = " . $nid);                  } elseif ($forum['topic']['reply_count'] != $article['reply_count']) {                      query("UPDATE NewsArticles                                   SET ReplyCount = " . $forum['topic']['reply_count'] . "                                     WHERE Id = " . $nid);                  }               }                               if ($this_page[$pagekey]['show'] == 'form') {                   if (in_array($action, array('new','reply'))) {                                          // Formulier aanpassen                      if (isset($this_page[$pagekey]['form']['objects']['title'])) {                          unset($this_page[$pagekey]['form']['objects']['title']);                        }                                               $this_page[$pagekey]['form']['form']['title'] = 'reactie plaatsen op bericht';                      $this_page['title'] = $this_page[$pagekey]['form']['form']['title'];                        $this_page[$pagekey]['form']['form']['label'] = 'Vul onderstaand formulier in om een reactie te geven op dit bericht. ' .                                                                                                                       'Alle reacties dienen te voldoen aan de algemene regels, die ook rechts van dit formulier zijn te vinden.';                                                 $this_page[$pagekey]['form']['objects']['ins_smilies']['label'] = 'Voeg smilies (emoticons) toe aan jouw reactie';                      $this_page[$pagekey]['form']['objects']['textfield']['label'] = 'Jouw reactie op het bericht';                      $this_page[$pagekey]['form']['objects']['submit_this']['label'] = 'Plaats reactie';                                                 $this_page[$pagekey]['form']['objects']['back']['label'] = 'Terug naar bericht';                        $this_page[$pagekey]['form']['objects']['back']['link'] = 'news.php?nid=' . $nid;                   } elseif ($action == 'modify') {                        // Formulier aanpassen                      $this_page[$pagekey]['form']['form']['title'] = 'reactie wijzigen';                     }               } elseif ($this_page[$pagekey]['show'] == 'status') {                                   // Status wijzigen bij nieuwe reacties                  if (in_array($this_page[$pagekey]['status'], array('newtopic', 'newreply'))) $this_page[$pagekey]['status'] = 'newsreply';              }           }           if (!isset($this_page[$pagekey]['show'])) {                 // Artikel converteren naar HTML                $this_page['title'] = $article['article_title'];                if ($weblog == 0) {                                     // Artikel, instellingen bepalen                    $this_page[$pagekey]['newslist'] = list_articles(0, $article['category_id'], 0, 0, $limit);                     $bbcode_settings = array('pages'           => true,                                                                      'page'            => $page + 1,                                                                     'no-language'       => true,                                                                    'bbcode'          => true,                                                                      'cites'                     => true,                                                                    'images'                => true,                                                                    'image_max_width' => 470);                                         // BBcode converteren                   $article['html'] = bbcode($article['article_text'], &$bbcode_settings);                     $this_page['title'] = 'Nieuws: ' . $this_page['title'];                     $this_page[$pagekey]['page'] = isset($bbcode_settings['page']) ? $bbcode_settings['page'] - 1 : 0;                  $this_page[$pagekey]['pagecount'] = isset($bbcode_settings['lastpage']) ? $bbcode_settings['lastpage'] : 1;                     $this_page[$pagekey]['show'] = 'article';               } else {                                    // Weblog                   $article['html'] = weblog2html($article['article_text']);                   $this_page['title'] = 'Weblog: ' . $this_page['title'];                     $this_page[$pagekey]['weblogs'] = list_articles(1, 0, 0, $article['member'], $limit, $page);                    $this_page[$pagekey]['show'] = 'weblog';                }               // Reacties weergeven               if ($article['reply_count'] > 0) {                  $user['replies_per_page'] = $article['reply_count'];                    $forum = get_replies($article['reply_id'], true, false, 0);                     $forum['url'] = $host . 'news.php?nid=' . $nid . '&';               }           }       } else {                    // Geen rechten             $this_page[$pagekey]['error'] = 'no_rights';            $this_page[$pagekey]['show'] = 'error';         }   } elseif (($cid > 0 || $tid > 0 || $member > 0) && $weblog == 0) {          // Overzicht categoriën/atikeltypen weergeven       $count_articles = count(list_articles(0, $cid, $tid, $member));         if ($count_articles == 0) {                     // Geen artikelen           $this_page[$pagekey]['error'] = 'no_articles';          $this_page[$pagekey]['show'] = 'error';         } else {                    // Lijst weergeven          $this_page[$pagekey]['pagecount'] = ceil($count_articles / $limit);             if ($page >= $this_page[$pagekey]['pagecount']) $page = $this_page[$pagekey]['pagecount'] - 1;          $this_page[$pagekey]['page'] = $page;                       $this_page[$pagekey]['newslist'] = list_articles(0, $cid, $tid, $member, $limit, $page);            $this_page[$pagekey]['show'] = 'newslist';      }   } elseif ($weblog == 1 && $member > 0) {            // Weblogoverzicht van een member weergeven         $count_weblogs = query("SELECT COUNT(1) count                                                     FROM NewsArticles                                                         WHERE Member = $member                                                       AND  Weblog = 1");         $count = mysql_result($count_weblogs, 0, 'count');              if ($count == 0) {                  // Geen weblog          $this_page[$pagekey]['error'] = 'no_weblogs';           $this_page[$pagekey]['show'] = 'error';         } else {                    // Lijst weergeven          $this_page[$pagekey]['pagecount'] = ceil($count / $limit);          if ($page >= $this_page[$pagekey]['pagecount']) $page = $this_page[$pagekey]['pagecount'] - 1;          $this_page[$pagekey]['page'] = $page;                       $this_page[$pagekey]['weblogs'] = list_articles(1, 0, 0, $member, $limit, $page);           $this_page['title'] = 'Weblogoverzicht van ' . $this_page[$pagekey]['weblogs'][0]['member_username'];           foreach ($this_page[$pagekey]['weblogs'] as $key => $item) {                $this_page[$pagekey]['weblogs'][$key]['html'] = weblog2html($item['article_text']);             }           $this_page[$pagekey]['show'] = 'weblogs';       }   } elseif ($dossier > 0) {           // Overzicht van een dossier weergeven      // --           } elseif ($weblog == 1)  {          // Overzicht van alle webloggers weergeven      xml_page('weblog');     } else {            // Algemeen XML-overzicht weergeven         xml_page('news');   }       function weblog2html ($article) {           // Artikel overzetten naar HTML         return bbcode($article,                                   array('no-language'       => true,                                              'bbcode'          => true,                                              'images'                => true,                                              'smilies'                   => true,                                                'image_max_width' => 300));     }       function get_article ($id) {                // Artikel opvragen         $article_query = query("

SELECT
    Article.Id article_id,
    Article.Hits article_hits,
    Article.Google article_google,
    Article.Visible article_visible,
    Article.Concept article_concept,
    Article.Weblog article_weblog,

Facts don't care about your feelings


Acties:
  • 0 Henk 'm!

  • RedHat
  • Registratie: Augustus 2000
  • Laatst online: 15:19
AS ?

Of was dat vroeger zo dat dat moest :+

Hmm, je code klopt van geen meter. Misschien moet je toch echt je lijnen opbreken zodat wij kunnen zien wat nou écht lijn 4 is?

[ Voor 58% gewijzigd door RedHat op 24-02-2012 21:37 ]


Acties:
  • 0 Henk 'm!

  • YoshiBignose
  • Registratie: April 2004
  • Laatst online: 12-09 14:51
Sorry, ik zag niet dat het zover doorliep. Zo iets duidelijker? Het lijkt me sterk dat de code voor geen meter klopt, het heeft immers gewoon gewerkt :P

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?      $pagekey = 'news';  $prefix = 'news.';      $this_page['menuitem'] = get_string('menu.' . $pagekey, 'setting', 'numeric');  $this_page[$pagekey] = array();      
    // Algemene waarden     $nid = get_string('nid', 'get', 'numeric');     $cid = get_string('cid', 'get', 'numeric');     $tid = get_string('tid', 'get', 'numeric'); 
    $dossier = get_string('dossier', 'get', 'numeric');     $member = get_string('member', 'get', 'numeric');       
// Weblogfunctie    if (!isset($weblog)) $weblog = get_string('weblog', 'get', 'numeric');  if ($weblog <> 1) $weblog = 0;  
    $limit = (get_string('limit', 'get', 'numeric') > 0) ? get_string('limit', 'get', 'numeric') :                      ((get_string(($weblog == 1 ? 'weblog.' : $prefix) . 'limit', 'setting', 'numeric') > 0) ? get_string(($weblog == 1 ? 'weblog.' : $prefix) . 'limit', 'setting', 'numeric') : 15);  
    // Paginanummer altijd corrigeren   $page = get_string('page', 'get', 'numeric');   if ($page < 0) $page = 0;       
// Previewfunctie   $preview = get_string('preview', 'get', 'numeric');     if ($preview <> 1) $preview = 0;        if ($nid > 0) {             // Artikel weergeven        $article = get_article($nid);       if ($article === false) {           
        // Geen artikel aangetroffen            $this_page[$pagekey]['error'] = 'no_article';           $this_page[$pagekey]['show'] = 'error';         } elseif ($article['rights']['right_read'] || ($article['rights']['right_preview'] && $preview == 1)) {             // Artikel weergeven            $this_page[$pagekey]['article'] = &$article;            if (!isset($_SESSION["news$nid"]) && $user['google'] == 0 && $user['rank'] != $mod_rank && $user['id'] != $article['member_id']) {              
    // Unieke bezoeker tellen               $article['article_hits'] ++;                query("UPDATE NewsArticles                           SET Hits = Hits + 1                             WHERE Id = $nid");                 $_SESSION["news$nid"] = 0;          } elseif ($user['google'] == 1 && $article['article_google'] == 0) {                            
    // Google heeft deze pagina gearchiveerd                $article['article_google'] = 1;                 query("UPDATE NewsArticles                           SET Google = 1                              WHERE Id = $nid");             }           if (!$article['rights']['right_hits']) $article['article_hits'] = 0;                if ($article['article_replies'] == 1 && action != '' && $preview == 0) {                        
    // Reactiefuncties uitvoeren en/of weergeven                $forumid = 0;               $topicid = $article['reply_id'];                $replyid = get_string('reply', 'get', 'numeric');               $moveto = 0;                $citeid = get_string('cite', 'get', 'numeric');             
    // Forumfuncties uitvoeren              $action = strtolower(get_string('action', 'get', 'string'));                if ($action == 'new') $action = 'reply';                $action = ($action == 'reply' && $topicid == 0) ? 'new' : ((!in_array($action, array('new', 'reply', 'modify', 'delete'))) ? '' : $action);                                 if ($action == 'new') {                                 
    // Eerste reactie                   $_POST['title'] = strtoupper($pagekey) . ': ' . $article['article_title'];                  forum_topic_action($host . 'news.php?nid=' . $nid);                     
// Kijken of er nu een nieuw onderwerp is aangemaakt, zo ja, opslaan                    if ($topicid > 0) {                         query("UPDATE NewsArticles                                   SET Topic          = $topicid                                       , ReplyCount = 1                                    WHERE Id = $nid");                     }               } elseif ($action != '') {                              
    // Overige reacties                     if ($action == 'delete') $topicid = 0;                  forum_topic_action($host . 'news.php?nid=' . $nid);                     
// Reactieteller bijwerken                  $forum = get_replies($article['reply_id'], false, true);                    if ($forum === false) {                         query("UPDATE NewsArticles                                   SET ReplyCount = 0                                          , Topic            = 0                                      WHERE Id = " . $nid);                  } elseif ($forum['topic']['reply_count'] != $article['reply_count']) {                      query("UPDATE NewsArticles                                   SET ReplyCount = " . $forum['topic']['reply_count'] . "                                     WHERE Id = " . $nid);                  }               }                               if ($this_page[$pagekey]['show'] == 'form') {                   if (in_array($action, array('new','reply'))) {                                          // Formulier aanpassen                      if (isset($this_page[$pagekey]['form']['objects']['title'])) {                          unset($this_page[$pagekey]['form']['objects']['title']);                        }                                               $this_page[$pagekey]['form']['form']['title'] = 'reactie plaatsen op bericht';                      $this_page['title'] = $this_page[$pagekey]['form']['form']['title'];                        $this_page[$pagekey]['form']['form']['label'] = 'Vul onderstaand formulier in om een reactie te geven op dit bericht. ' .                                                                                                                       'Alle reacties dienen te voldoen aan de algemene regels, die ook rechts van dit formulier zijn te vinden.';                                                 $this_page[$pagekey]['form']['objects']['ins_smilies']['label'] = 'Voeg smilies (emoticons) toe aan jouw reactie';                      $this_page[$pagekey]['form']['objects']['textfield']['label'] = 'Jouw reactie op het bericht';                      $this_page[$pagekey]['form']['objects']['submit_this']['label'] = 'Plaats reactie';                                                 $this_page[$pagekey]['form']['objects']['back']['label'] = 'Terug naar bericht';                        $this_page[$pagekey]['form']['objects']['back']['link'] = 'news.php?nid=' . $nid;                   } elseif ($action == 'modify') {                        
// Formulier aanpassen                      $this_page[$pagekey]['form']['form']['title'] = 'reactie wijzigen';                     }               } elseif ($this_page[$pagekey]['show'] == 'status') {                                   
// Status wijzigen bij nieuwe reacties                  if (in_array($this_page[$pagekey]['status'], array('newtopic', 'newreply'))) $this_page[$pagekey]['status'] = 'newsreply';              }           }           if (!isset($this_page[$pagekey]['show'])) {                 // Artikel converteren naar HTML                $this_page['title'] = $article['article_title'];                if ($weblog == 0) {                                     // Artikel, instellingen bepalen                    $this_page[$pagekey]['newslist'] = list_articles(0, $article['category_id'], 0, 0, $limit);                     $bbcode_settings = array('pages'           => true,                                                                      'page'            => $page + 1,                                                                     'no-language'       => true,                                                                    'bbcode'          => true,                                                                      'cites'                     => true,                                                                    'images'                => true,                                                                    'image_max_width' => 470);                                         
// BBcode converteren                   $article['html'] = bbcode($article['article_text'], &$bbcode_settings);                     $this_page['title'] = 'Nieuws: ' . $this_page['title'];                     $this_page[$pagekey]['page'] = isset($bbcode_settings['page']) ? $bbcode_settings['page'] - 1 : 0;                  $this_page[$pagekey]['pagecount'] = isset($bbcode_settings['lastpage']) ? $bbcode_settings['lastpage'] : 1;                     $this_page[$pagekey]['show'] = 'article';               } else {                                    // Weblog                   $article['html'] = weblog2html($article['article_text']);                   $this_page['title'] = 'Weblog: ' . $this_page['title'];                     $this_page[$pagekey]['weblogs'] = list_articles(1, 0, 0, $article['member'], $limit, $page);                    $this_page[$pagekey]['show'] = 'weblog';                }               
// Reacties weergeven               if ($article['reply_count'] > 0) {                  $user['replies_per_page'] = $article['reply_count'];                    $forum = get_replies($article['reply_id'], true, false, 0);                     $forum['url'] = $host . 'news.php?nid=' . $nid . '&';               }           }       } else {                    
// Geen rechten             $this_page[$pagekey]['error'] = 'no_rights';            $this_page[$pagekey]['show'] = 'error';         }   } elseif (($cid > 0 || $tid > 0 || $member > 0) && $weblog == 0) {          
// Overzicht categoriën/atikeltypen weergeven       $count_articles = count(list_articles(0, $cid, $tid, $member));         if ($count_articles == 0) {                     
// Geen artikelen           $this_page[$pagekey]['error'] = 'no_articles';          $this_page[$pagekey]['show'] = 'error';         } else {                    
// Lijst weergeven          $this_page[$pagekey]['pagecount'] = ceil($count_articles / $limit);             if ($page >= $this_page[$pagekey]['pagecount']) $page = $this_page[$pagekey]['pagecount'] - 1;          $this_page[$pagekey]['page'] = $page;                       $this_page[$pagekey]['newslist'] = list_articles(0, $cid, $tid, $member, $limit, $page);            $this_page[$pagekey]['show'] = 'newslist';      }   } elseif ($weblog == 1 && $member > 0) {            
// Weblogoverzicht van een member weergeven         $count_weblogs = query("SELECT COUNT(1) count                                                     FROM NewsArticles                                                         WHERE Member = $member                                                       AND  Weblog = 1");         $count = mysql_result($count_weblogs, 0, 'count');              if ($count == 0) {                  
// Geen weblog          $this_page[$pagekey]['error'] = 'no_weblogs';           $this_page[$pagekey]['show'] = 'error';         } else {                    
// Lijst weergeven          $this_page[$pagekey]['pagecount'] = ceil($count / $limit);          if ($page >= $this_page[$pagekey]['pagecount']) $page = $this_page[$pagekey]['pagecount'] - 1;          $this_page[$pagekey]['page'] = $page;                       $this_page[$pagekey]['weblogs'] = list_articles(1, 0, 0, $member, $limit, $page);           $this_page['title'] = 'Weblogoverzicht van ' . $this_page[$pagekey]['weblogs'][0]['member_username'];           foreach ($this_page[$pagekey]['weblogs'] as $key => $item) {                $this_page[$pagekey]['weblogs'][$key]['html'] = weblog2html($item['article_text']);             }           $this_page[$pagekey]['show'] = 'weblogs';       }   } elseif ($dossier > 0) {           // Overzicht van een dossier weergeven      // --           } elseif ($weblog == 1)  {          // Overzicht van alle webloggers weergeven      xml_page('weblog');     } else {            // Algemeen XML-overzicht weergeven         xml_page('news');   }       function weblog2html ($article) {           
// Artikel overzetten naar HTML         return bbcode($article,                                   array('no-language'       => true,                                              'bbcode'          => true,                                              'images'                => true,                                              'smilies'                   => true,                                                'image_max_width' => 300));     }       function get_article ($id) {                
// Artikel opvragen         $article_query = query("

Facts don't care about your feelings


Acties:
  • 0 Henk 'm!

  • aaajeetee
  • Registratie: Augustus 2002
  • Laatst online: 18-09 12:49
Omg wat een onoverzichtelijk stuk(je) code. Ik ben halverwege regel 4 afgehaakt :s

Acties:
  • 0 Henk 'm!

  • YoshiBignose
  • Registratie: April 2004
  • Laatst online: 12-09 14:51
Ja volgens mij was het een zelfgemaakt CMS'je :P ik heb ook geen idee wat dan line 4 moet voorstellen en waar dus de fout zit. ;(

Facts don't care about your feelings


Acties:
  • 0 Henk 'm!

  • Onbekend
  • Registratie: Juni 2005
  • Laatst online: 20:46

Onbekend

...

Haal nu eens alle overbodige code eruit, en post alleen die regel 4 die ook nog eens goed uitgelijnd is.
Post ook eens de de functies die op regel 4 aangeroepen worden.

Speel ook Balls Connect en Repeat


Acties:
  • 0 Henk 'm!

  • RedHat
  • Registratie: Augustus 2000
  • Laatst online: 15:19
Onbekend schreef op vrijdag 24 februari 2012 @ 21:51:
Haal nu eens alle overbodige code eruit, en post alleen die regel 4 die ook nog eens goed uitgelijnd is.
Post ook eens de de functies die op regel 4 aangeroepen worden.
QFT.

Hier kunnen wij namelijk niets mee. WIj moeten weten wát regel 4 exact is en de code achter regel 4 (functies e.d.).

Dit is brabbelbrei voor ons.

Acties:
  • 0 Henk 'm!

  • YoshiBignose
  • Registratie: April 2004
  • Laatst online: 12-09 14:51
Ja maar hoe weet ik wat precies regel 4 is dan... als ik het bestand open in wordpad dan zie ik een hoop tekst, maar als ik het hier plak is het 1 regel...

code:
1
<?      $pagekey = 'news';  $prefix = 'news.';      $this_page['menuitem'] = get_string('menu.' . $pagekey, 'setting', 'numeric');  $this_page[$pagekey] = array();         // Algemene waarden     $nid = get_string('nid', 'get', 'numeric');     $cid = get_string('cid', 'get', 'numeric');     $tid = get_string('tid', 'get', 'numeric');     $dossier = get_string('dossier', 'get', 'numeric');     $member = get_string('member', 'get', 'numeric');       // Weblogfunctie    if (!isset($weblog)) $weblog = get_string('weblog', 'get', 'numeric');  if ($weblog <> 1) $weblog = 0;      $limit = (get_string('limit', 'get', 'numeric') > 0) ? get_string('limit', 'get', 'numeric') :                      ((get_string(($weblog == 1 ? 'weblog.' : $prefix) . 'limit', 'setting', 'numeric') > 0) ? get_string(($weblog == 1 ? 'weblog.' : $prefix) . 'limit', 'setting', 'numeric') : 15);   // Paginanummer altijd corrigeren   $page = get_string('page', 'get', 'numeric');   if ($page < 0) $page = 0;       // Previewfunctie   $preview = get_string('preview', 'get', 'numeric');     if ($preview <> 1) $preview = 0;        if ($nid > 0) {             // Artikel weergeven        $article = get_article($nid);       if ($article === false) {                   // Geen artikel aangetroffen            $this_page[$pagekey]['error'] = 'no_article';           $this_page[$pagekey]['show'] = 'error';         } elseif ($article['rights']['right_read'] || ($article['rights']['right_preview'] && $preview == 1)) {             // Artikel weergeven            $this_page[$pagekey]['article'] = &$article;            if (!isset($_SESSION["news$nid"]) && $user['google'] == 0 && $user['rank'] != $mod_rank && $user['id'] != $article['member_id']) {                  // Unieke bezoeker tellen               $article['article_hits'] ++;                query("UPDATE NewsArticles                           SET Hits = Hits + 1                             WHERE Id = $nid");                 $_SESSION["news$nid"] = 0;          } elseif ($user['google'] == 1 && $article['article_google'] == 0) {                                // Google heeft deze pagina gearchiveerd                $article['article_google'] = 1;                 query("UPDATE NewsArticles                           SET Google = 1                              WHERE Id = $nid");             }           if (!$article['rights']['right_hits']) $article['article_hits'] = 0;                if ($article['article_replies'] == 1 && action != '' && $preview == 0) {                            // Reactiefuncties uitvoeren en/of weergeven                $forumid = 0;               $topicid = $article['reply_id'];                $replyid = get_string('reply', 'get', 'numeric');               $moveto = 0;                $citeid = get_string('cite', 'get', 'numeric');                 // Forumfuncties uitvoeren              $action = strtolower(get_string('action', 'get', 'string'));                if ($action == 'new') $action = 'reply';                $action = ($action == 'reply' && $topicid == 0) ? 'new' : ((!in_array($action, array('new', 'reply', 'modify', 'delete'))) ? '' : $action);                                 if ($action == 'new') {                                     // Eerste reactie                   $_POST['title'] = strtoupper($pagekey) . ': ' . $article['article_title'];                  forum_topic_action($host . 'news.php?nid=' . $nid);                     // Kijken of er nu een nieuw onderwerp is aangemaakt, zo ja, opslaan                    if ($topicid > 0) {                         query("UPDATE NewsArticles                                   SET Topic          = $topicid                                       , ReplyCount = 1                                    WHERE Id = $nid");                     }               } elseif ($action != '') {                                  // Overige reacties                     if ($action == 'delete') $topicid = 0;                  forum_topic_action($host . 'news.php?nid=' . $nid);                     // Reactieteller bijwerken                  $forum = get_replies($article['reply_id'], false, true);                    if ($forum === false) {                         query("UPDATE NewsArticles                                   SET ReplyCount = 0                                          , Topic            = 0                                      WHERE Id = " . $nid);                  } elseif ($forum['topic']['reply_count'] != $article['reply_count']) {                      query("UPDATE NewsArticles                                   SET ReplyCount = " . $forum['topic']['reply_count'] . "                                     WHERE Id = " . $nid);                  }               }                               if ($this_page[$pagekey]['show'] == 'form') {                   if (in_array($action, array('new','reply'))) {                                          // Formulier aanpassen                      if (isset($this_page[$pagekey]['form']['objects']['title'])) {                          unset($this_page[$pagekey]['form']['objects']['title']);                        }                                               $this_page[$pagekey]['form']['form']['title'] = 'reactie plaatsen op bericht';                      $this_page['title'] = $this_page[$pagekey]['form']['form']['title'];                        $this_page[$pagekey]['form']['form']['label'] = 'Vul onderstaand formulier in om een reactie te geven op dit bericht. ' .                                                                                                                       'Alle reacties dienen te voldoen aan de algemene regels, die ook rechts van dit formulier zijn te vinden.';                                                 $this_page[$pagekey]['form']['objects']['ins_smilies']['label'] = 'Voeg smilies (emoticons) toe aan jouw reactie';                      $this_page[$pagekey]['form']['objects']['textfield']['label'] = 'Jouw reactie op het bericht';                      $this_page[$pagekey]['form']['objects']['submit_this']['label'] = 'Plaats reactie';                                                 $this_page[$pagekey]['form']['objects']['back']['label'] = 'Terug naar bericht';                        $this_page[$pagekey]['form']['objects']['back']['link'] = 'news.php?nid=' . $nid;                   } elseif ($action == 'modify') {                        // Formulier aanpassen                      $this_page[$pagekey]['form']['form']['title'] = 'reactie wijzigen';                     }               } elseif ($this_page[$pagekey]['show'] == 'status') {                                   // Status wijzigen bij nieuwe reacties                  if (in_array($this_page[$pagekey]['status'], array('newtopic', 'newreply'))) $this_page[$pagekey]['status'] = 'newsreply';              }           }           if (!isset($this_page[$pagekey]['show'])) {                 // Artikel converteren naar HTML                $this_page['title'] = $article['article_title'];                if ($weblog == 0) {                                     // Artikel, instellingen bepalen                    $this_page[$pagekey]['newslist'] = list_articles(0, $article['category_id'], 0, 0, $limit);                     $bbcode_settings = array('pages'           => true,                                                                      'page'            => $page + 1,                                                                     'no-language'       => true,                                                                    'bbcode'          => true,                                                                      'cites'                     => true,                                                                    'images'                => true,                                                                    'image_max_width' => 470);                                         // BBcode converteren                   $article['html'] = bbcode($article['article_text'], &$bbcode_settings);                     $this_page['title'] = 'Nieuws: ' . $this_page['title'];                     $this_page[$pagekey]['page'] = isset($bbcode_settings['page']) ? $bbcode_settings['page'] - 1 : 0;                  $this_page[$pagekey]['pagecount'] = isset($bbcode_settings['lastpage']) ? $bbcode_settings['lastpage'] : 1;                     $this_page[$pagekey]['show'] = 'article';               } else {                                    // Weblog                   $article['html'] = weblog2html($article['article_text']);                   $this_page['title'] = 'Weblog: ' . $this_page['title'];                     $this_page[$pagekey]['weblogs'] = list_articles(1, 0, 0, $article['member'], $limit, $page);                    $this_page[$pagekey]['show'] = 'weblog';                }               // Reacties weergeven               if ($article['reply_count'] > 0) {                  $user['replies_per_page'] = $article['reply_count'];                    $forum = get_replies($article['reply_id'], true, false, 0);                     $forum['url'] = $host . 'news.php?nid=' . $nid . '&';               }           }       } else {                    // Geen rechten             $this_page[$pagekey]['error'] = 'no_rights';            $this_page[$pagekey]['show'] = 'error';         }   } elseif (($cid > 0 || $tid > 0 || $member > 0) && $weblog == 0) {          // Overzicht categoriën/atikeltypen weergeven       $count_articles = count(list_articles(0, $cid, $tid, $member));         if ($count_articles == 0) {                     // Geen artikelen           $this_page[$pagekey]['error'] = 'no_articles';          $this_page[$pagekey]['show'] = 'error';         } else {                    // Lijst weergeven          $this_page[$pagekey]['pagecount'] = ceil($count_articles / $limit);             if ($page >= $this_page[$pagekey]['pagecount']) $page = $this_page[$pagekey]['pagecount'] - 1;          $this_page[$pagekey]['page'] = $page;                       $this_page[$pagekey]['newslist'] = list_articles(0, $cid, $tid, $member, $limit, $page);            $this_page[$pagekey]['show'] = 'newslist';      }   } elseif ($weblog == 1 && $member > 0) {            // Weblogoverzicht van een member weergeven         $count_weblogs = query("SELECT COUNT(1) count                                                     FROM NewsArticles                                                         WHERE Member = $member                                                       AND  Weblog = 1");         $count = mysql_result($count_weblogs, 0, 'count');              if ($count == 0) {                  // Geen weblog          $this_page[$pagekey]['error'] = 'no_weblogs';           $this_page[$pagekey]['show'] = 'error';         } else {                    // Lijst weergeven          $this_page[$pagekey]['pagecount'] = ceil($count / $limit);          if ($page >= $this_page[$pagekey]['pagecount']) $page = $this_page[$pagekey]['pagecount'] - 1;          $this_page[$pagekey]['page'] = $page;                       $this_page[$pagekey]['weblogs'] = list_articles(1, 0, 0, $member, $limit, $page);           $this_page['title'] = 'Weblogoverzicht van ' . $this_page[$pagekey]['weblogs'][0]['member_username'];           foreach ($this_page[$pagekey]['weblogs'] as $key => $item) {                $this_page[$pagekey]['weblogs'][$key]['html'] = weblog2html($item['article_text']);             }           $this_page[$pagekey]['show'] = 'weblogs';       }   } elseif ($dossier > 0) {           // Overzicht van een dossier weergeven      // --           } elseif ($weblog == 1)  {          // Overzicht van alle webloggers weergeven      xml_page('weblog');     } else {            // Algemeen XML-overzicht weergeven         xml_page('news');   }       function weblog2html ($article) {           // Artikel overzetten naar HTML         return bbcode($article,                                   array('no-language'       => true,                                              'bbcode'          => true,                                              'images'                => true,                                              'smilies'                   => true,                                                'image_max_width' => 300));     }       function get_article ($id) {                // Artikel opvragen         $article_query = query("

Facts don't care about your feelings


Acties:
  • 0 Henk 'm!

  • Ventieldopje
  • Registratie: December 2005
  • Laatst online: 19-09 11:00

Ventieldopje

I'm not your pal, mate!

De meeste mensen zou ik aanraden om te leren debuggen, jou raad ik echter aan eerst maar eens je code op te schonen :+

www.maartendeboer.net
1D X | 5Ds | Zeiss Milvus 25, 50, 85 f/1.4 | Zeiss Otus 55 f/1.4 | Canon 200 f/1.8 | Canon 200 f/2 | Canon 300 f/2.8


Acties:
  • 0 Henk 'm!

  • RobIII
  • Registratie: December 2001
  • Niet online

RobIII

Admin Devschuur®

^ Romeinse Ⅲ ja!

(overleden)
Gebruik een editor die met \r\n én \n overweg kan, of blijf uit de buurt van obfuscated code die niet van jou is ;)

[ Voor 22% gewijzigd door RobIII op 24-02-2012 22:05 ]

There are only two hard problems in distributed systems: 2. Exactly-once delivery 1. Guaranteed order of messages 2. Exactly-once delivery.

Je eigen tweaker.me redirect

Over mij


Acties:
  • 0 Henk 'm!

  • YoshiBignose
  • Registratie: April 2004
  • Laatst online: 12-09 14:51
Weet jij zo'n programma dan met newline zodat het iets duidelijker wordt?

Facts don't care about your feelings


Acties:
  • 0 Henk 'm!

  • Onbekend
  • Registratie: Juni 2005
  • Laatst online: 20:46

Onbekend

...

Je kan ook zelf even zoeken hè?
http://notepad-plus-plus.org/download/v5.9.8.html

Speel ook Balls Connect en Repeat


Acties:
  • 0 Henk 'm!

  • RobIII
  • Registratie: December 2001
  • Niet online

RobIII

Admin Devschuur®

^ Romeinse Ⅲ ja!

(overleden)
YoshiBignose schreef op vrijdag 24 februari 2012 @ 22:11:
Weet jij zo'n programma dan met newline zodat het iets duidelijker wordt?
Sorry, maar het is hier geen crèche. Een heel klein beetje zelf moeite doen mag wel. We zijn nu 13 posts verder en hebben nog in de verste verte niets zinnigs om je mee te kunnen helpen en nu moeten we je ook nog aan een IDE helpen? Nee, dat gaat er bij mij niet in. Knock yourself out, meer en nog meer en een encore.

Open gerust een nieuw topic; maar zorg dan dat de startpost voorzien is van alle informatie die we nodig hebben om je te kunnen helpen én dat die informatie leesbaar is.

[ Voor 31% gewijzigd door RobIII op 24-02-2012 22:17 ]

There are only two hard problems in distributed systems: 2. Exactly-once delivery 1. Guaranteed order of messages 2. Exactly-once delivery.

Je eigen tweaker.me redirect

Over mij


Acties:
  • 0 Henk 'm!

  • NMe
  • Registratie: Februari 2004
  • Laatst online: 09-09 13:58

NMe

Quia Ego Sic Dico.

RobIII schreef op vrijdag 24 februari 2012 @ 22:12:
[...]

Open gerust een nieuw topic;
Ook dat niet eigenlijk. Parse errors zijn altijd tikfouten. Vergeten haakjes, vergeten quotes. En een goeie editor haalt die er al voor je uit door ze rood te onderstrepen. Met een klein beetje eigen inzet heb je die fouten er zelf uit.

[ Voor 9% gewijzigd door NMe op 24-02-2012 22:21 ]

'E's fighting in there!' he stuttered, grabbing the captain's arm.
'All by himself?' said the captain.
'No, with everyone!' shouted Nobby, hopping from one foot to the other.

Pagina: 1

Dit topic is gesloten.