vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   script returns error...:( (https://vborg.vbsupport.ru/showthread.php?t=36152)

N!ck 03-15-2002 02:02 AM

script returns error...:(
 
this produces a parse error on the last line (supposedly...)

help!

PHP Code:

<?
// Latest Threads on Your Desktop
// SPECIAL EDITION
// Settings:
$numposts = 30; // Number of posts to show
$viewprivate = "off"; // View messages and announcements in private forums? ("on"/"off")
// ^-- Note: setting this to "off" may cause less posts than set to appear.
$announcements = "on"; // Show announcements?  ("on"/"off")
$announcementsn = 5; // Number of announcements to show.
// Do not edit past this point unless you know what you're doing.

$templatesused .= "latest,latestbit";
if ($announcements == "on") {
 $templatesused .= ",latestbit_announcement";
}
require("./global.php");

if ($announcements == "on") {
 $announcementsql = $DB_site->query("SELECT * FROM announcement ORDER BY startdate DESC, enddate LIMIT $announcementsn");
 if ($viewprivate == "off") {
  while ($announcement = $DB_site->fetch_array($announcementsql)) {
   $aperms = getpermissions($announcement['forumid']);
   if ($aperms[canview]) {
    eval("\$latest .= \"".gettemplate("latestbit_announcement")."\";");
   }
  }
 } else {
  while ($latestbit_announcement = $DB_site->fetch_array($announcementsql)) {
   eval("\$latest .= \"".gettemplate("latestbit_announcement")."\";");
  }
 }

$threadsql = $DB_site->query("SELECT * FROM thread ORDER BY lastpost DESC LIMIT $numposts");

  if ($viewprivate == "off") {
   while ($thread = $DB_site->fetch_array($threadsql)) {
    $perms = getpermissions($thread[forumid]);
    if ($perms[canview]) {
     eval("\$latest .= \"".gettemplate("latestbit")."\";");
    }
   }
  } else {
   while ($thread = $DB_site->fetch_array($threadsql)) {
    eval("\$latest .= \"".gettemplate("latestbit")."\";");
   }
  }
eval("dooutput(\"".gettemplate('latest')."\");");
?>


Lesane 03-15-2002 08:13 AM

You are using ' ' in your last line instead of " "

eval("dooutput(\"".gettemplate('latest')."\");");

Must probably be:

eval("dooutput(\"".gettemplate("latest")."\");");

N!ck 03-15-2002 07:02 PM

nah...that's not it :(

Lesane 03-15-2002 07:14 PM

You forgot a } on the end, so the good script is like this:

PHP Code:

<?
// Latest Threads on Your Desktop
// SPECIAL EDITION
// Settings:
$numposts = 30; // Number of posts to show
$viewprivate = "off"; // View messages and announcements in private forums? ("on"/"off")
// ^-- Note: setting this to "off" may cause less posts than set to appear.
$announcements = "on"; // Show announcements?  ("on"/"off")
$announcementsn = 5; // Number of announcements to show.
// Do not edit past this point unless you know what you're doing.

$templatesused .= "latest,latestbit";
if ($announcements == "on") {
 $templatesused .= ",latestbit_announcement";
}
require("./global.php");

if ($announcements == "on") {
 $announcementsql = $DB_site->query("SELECT * FROM announcement ORDER BY startdate DESC, enddate LIMIT $announcementsn");
 if ($viewprivate == "off") {
  while ($announcement = $DB_site->fetch_array($announcementsql)) {
   $aperms = getpermissions($announcement['forumid']);
   if ($aperms[canview]) {
    eval("\$latest .= \"".gettemplate("latestbit_announcement")."\";");
   }
  }
 } else {
  while ($latestbit_announcement = $DB_site->fetch_array($announcementsql)) {
   eval("\$latest .= \"".gettemplate("latestbit_announcement")."\";");
  }
 }

$threadsql = $DB_site->query("SELECT * FROM thread ORDER BY lastpost DESC LIMIT $numposts");

  if ($viewprivate == "off") {
   while ($thread = $DB_site->fetch_array($threadsql)) {
    $perms = getpermissions($thread[forumid]);
    if ($perms[canview]) {
     eval("\$latest .= \"".gettemplate("latestbit")."\";");
    }
   }
  } else {
   while ($thread = $DB_site->fetch_array($threadsql)) {
    eval("\$latest .= \"".gettemplate("latestbit")."\";");
   }
  }
eval("dooutput(\"".gettemplate('latest')."\");");
}
?>


N!ck 03-15-2002 08:07 PM

boy do i feel stupid. thanks lesane


All times are GMT. The time now is 10:06 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00925 seconds
  • Memory Usage 1,728KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete