vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Need Hack : lat 10 posts in a marquee (https://vborg.vbsupport.ru/showthread.php?t=26695)

charsima 08-28-2001 10:36 AM

I need the hack that shows the last 10 posts in a marquee at the top of the forum .

Does anyone know from where to get it ?

Admin 08-28-2001 05:15 PM

I'm already working on this. :)

Admin 08-28-2001 05:35 PM

Add this code in your phpinclude template:
PHP Code:

$latestposts=$DB_site->query("SELECT postid,LEFT(pagetext,20) AS text FROM post ORDER BY dateline DESC LIMIT 10");
while (
$latestpost=$DB_site->fetch_array($latestposts)) {
  if (
$marquee) {
    
$marquee .= "  ";  // String to seperate between each link
  
}
  
$marquee .= "<a href=\"showthread.php?s=$session[sessionhash]&postid=$latestpost[postid]\">$latestpost[text] ...</a>"// Link and text for post


Now you can use $marquee in your marquee tag for the content.
This will only select the first 20 characters of the post, and add ... after it (with a link to the post).

webhost 08-30-2001 06:52 PM

Is it possible to use this on a non vb page?

Admin 08-30-2001 06:56 PM

Create this page as marquee.php
PHP Code:

<?php

error_reporting
(7);

require(
"./global.php");

$latestposts=$DB_site->query("SELECT postid,LEFT(pagetext,20) AS text FROM post ORDER BY dateline DESC LIMIT 10");
while (
$latestpost=$DB_site->fetch_array($latestposts)) {
  if (
$marquee) {
    
$marquee .= "&nbsp;&nbsp;";  // String to seperate between each link
  
}
  
$marquee .= "<a href=\"showthread.php?s=$session[sessionhash]&postid=$latestpost[postid]\">$latestpost[text] ...</a>";
}
?>
<marquee-code-here value="<? echo("$marquee"); ?>">

and put it in your forum's root.

Now just use SSI to include it
Code:

<!--#include file="vbb/marquee.php"-->
and also change the actually code for the marquee as I don't know it.

webhost 08-31-2001 07:24 PM

Great Hack Firefly.

Need an addon if possible.

I would like to for example exclude forumid 14, 43, 87 from the marquee.How would I do this?

Admin 09-01-2001 05:43 AM

Try this code
PHP Code:

<?php

error_reporting
(7);

require(
"./global.php");

$latestposts=$DB_site->query("SELECT postid,LEFT(pagetext,20) AS text FROM post WHERE forumid<>14 AND forumid<>43 AND forumid<>87 ORDER BY dateline DESC LIMIT 10");
while (
$latestpost=$DB_site->fetch_array($latestposts)) {
  if (
$marquee) {
    
$marquee .= "&nbsp;&nbsp;";  // String to seperate between each link
  
}
  
$marquee .= "<a href=\"showthread.php?s=$session[sessionhash]&postid=$latestpost[postid]\">$latestpost[text] ...</a>";
}
?>
<marquee-code-here value="<? echo("$marquee"); ?>">

I think that's it... try it. :)

webhost 09-01-2001 11:06 AM

error with this. it worker before I made the change to exclude forums.

<b>Warning</b>: Cannot add header information - headers already sent by (output started at /home/realweb/public_html/marquee.php:13) in <b>/home/realweb/public_html/forums/admin/functions.php</b> on line <b>1486</b><br>

<!-- Database error in vBulletin: Invalid SQL: SELECT postid,LEFT(pagetext,20) AS text FROM post WHERE forumid<>45 AND forumid<>30 AND forumid<>33 AND forumid<>93 AND forumid<>40 AND forumid<>41 AND forumid<>38 AND forumid<>39 AND forumid<>42 AND forumid<>43 AND forumid<>46 AND forumid<>54 AND forumid<>48 AND forumid<>61 AND forumid<>50 AND forumid<>51 AND forumid<>52 AND forumid<>53 AND forumid<>55 AND forumid<>56 AND forumid<>57 AND forumid<>58 AND forumid<>59 AND forumid<>60 AND forumid<>62 AND forumid<>75 AND forumid<>70 AND forumid<>72 AND forumid<>69 AND forumid<>67 AND forumid<>68 AND forumid<>71 AND forumid<>76 AND forumid<>77 AND forumid<>78 AND forumid<>79 AND forumid<>80 AND forumid<>81 AND forumid<>82 AND forumid<>83 AND forumid<>90 AND forumid<>91 AND forumid<>88 AND forumid<>89 AND forumid<>92 ORDER BY dateline DESC LIMIT 10
mysql error: Unknown column 'forumid' in 'where clause'
mysql error number: 1054
Date: Saturday 01st of September 2001 06:04:47 AM
Script: /marquee.php
Referer:
-->
</td></tr></table>
<p>There seems to have been a slight problem with the database.
Please try again by pressing the refresh button in your browser.</p>An E-Mail has been dispatched to our <a href="mailto:support@realwebhost.net">Technical Staff</a>, who you can also contact if the problem persists.</p><p>We apologise for any inconvenience.</p><pre>

Database error in vBulletin: Invalid SQL: SELECT postid,LEFT(pagetext,20) AS text FROM post WHERE forumid<>45 AND forumid<>30 AND forumid<>33 AND forumid<>93 AND forumid<>40 AND forumid<>41 AND forumid<>38 AND forumid<>39 AND forumid<>42 AND forumid<>43 AND forumid<>46 AND forumid<>54 AND forumid<>48 AND forumid<>61 AND forumid<>50 AND forumid<>51 AND forumid<>52 AND forumid<>53 AND forumid<>55 AND forumid<>56 AND forumid<>57 AND forumid<>58 AND forumid<>59 AND forumid<>60 AND forumid<>62 AND forumid<>75 AND forumid<>70 AND forumid<>72 AND forumid<>69 AND forumid<>67 AND forumid<>68 AND forumid<>71 AND forumid<>76 AND forumid<>77 AND forumid<>78 AND forumid<>79 AND forumid<>80 AND forumid<>81 AND forumid<>82 AND forumid<>83 AND forumid<>90 AND forumid<>91 AND forumid<>88 AND forumid<>89 AND forumid<>92 ORDER BY dateline DESC LIMIT 10
mysql error: Unknown column 'forumid' in 'where clause'
mysql error number: 1054
Date: Saturday 01st of September 2001 06:04:47 AM
Script: /marquee.php
Referer:


</pre>

Stasik 09-01-2001 12:04 PM

there is no forumsid column in post table :( we have to search in tread table with threadid, but i dont know how to do in in mySQL :(

Admin 09-01-2001 12:07 PM

Yeah you're right.

I'll see if I can do this...


All times are GMT. The time now is 11:58 PM.

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.01177 seconds
  • Memory Usage 1,754KB
  • 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
  • (1)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete