vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   vB Tetris v2.1 Addon - The Tetris King! (https://vborg.vbsupport.ru/showthread.php?t=42317)

John 08-14-2002 10:00 PM

vB Tetris v2.1 Addon - The Tetris King!
 
This hack
What's this? Another tetris related hack?!

I'm afraid so! This hack will place a picture of a crown next to the username of the member with the highest score (in every one of their posts). When you pass the cursor over the crown, it says "King of Tetris!"


Compatibility issues
If you have my vB Tetris 2.1 hack installed, this hack will work for you.


Testing and installation version
This hack has been tested on a fresh install of vB 2.2.6 both locally and remotely. Should work on 2.x.x versions.


And finally...
Thanks to...
? DestyNova - for coming up with the idea!
? Chen - for pointing me in the right direction :D

John 08-15-2002 11:17 AM

Screenshot:

michealo 08-15-2002 11:24 AM

great idea

gonna install it later, thanks

xxskullxx 08-15-2002 11:31 AM

Works great on my test board! :) Good work!

[high]* xxskullxx still waiting patiently ;)[/high]

Floris 08-15-2002 11:34 AM

If this is all tetris related .. why not post in the tetris main thread? ..

John 08-15-2002 11:36 AM

You're right, although this is a hack, I suppose it should be with the tetris thread.

In the future I'll post it all under one thread :( :banana:

NexDog 08-15-2002 11:52 AM

This isn't working on my board. :(

John 08-15-2002 11:54 AM

Quote:

Originally posted by NexDog
This isn't working on my board. :(
That's because for some reason your highest scorer doesn't have a user id - delete that record, and it should work.

kypdurron 08-15-2002 12:06 PM

I think this does belong on a different thread as its a different hack..

anyway, I get the following error:

Fatal error: Call to a member function on a non-object in ../forums/showthread.php on line 7

I'm using version 2.2.5...

any ideas?

I added a "require(./global.php);" before, but that just
leaves the page blank..

John 08-15-2002 12:11 PM

Quote:

Originally posted by kypdurron
I think this does belong on a different thread as its a different hack..


anyway, I get the following error:

Fatal error: Call to a member function on a non-object in ../forums/showthread.php on line 7

I'm using version 2.2.5...

any ideas?

I added a "require(./global.php);" before, but that just
leaves the page blank..

What is your line 7?

NexDog 08-15-2002 12:11 PM

Yep, did that and it works. Clicks install for the 4th time today. :)

John 08-15-2002 12:12 PM

:banana:

DestyNova 08-15-2002 03:27 PM

LOL! thanks JohnW :thumbup: I m going definetly use it! :banana:

michealo 08-15-2002 03:55 PM

JW, with this step

Code:

In showthread.php
2. FIND:
###########################

// words to highlight from the search engine

###########################

AND ABOVE IT ADD:
###########################

$leaderboard = $DB_site->query_first('SELECT userid FROM arcade WHERE game = "tetris" ORDER BY score DESC');
$kingid = $leaderboard['userid'];

###########################

i get this error

Quote:

Fatal error: Call to a member function on a non-object in /home/sites/home/web/forums/showthread.php on line 6
ONLY when clicking on links that contain the "king tetris" member. everything else seems to be fine

Kars10 08-15-2002 04:04 PM

@ Michealo, the same error i get!!
John is watching my showthread.php...hope it works!! :confused:

xxxsaint 08-15-2002 04:17 PM

i think that saying this hack needs to go under the tetris thread would be like saying every store related add on for lesane's store needs to go in that thread.

Thanks for the great hack , and this , the great ADD ON !! :thumbsup:

John 08-15-2002 04:26 PM

michealo and Minifreunde -

Change
#########################

$leaderboard = $DB_site->query_first

#########################

to
#########################
$leaderboard = $DB_site->query
#########################

And tell me if it works

michealo 08-15-2002 04:35 PM

no good im afraid

Quote:

Fatal error: Call to a member function on a non-object in /home/sites/home/web/forums/showthread.php on line 7"
but now no links work, every thread i click gives that error

kypdurron 08-15-2002 04:37 PM

I did that and still didn't work. I think the problem is that it doesn't know what $DB_Site is, not the query itself.
I am using 2.2.5. Is there an "include" command somewhere on your showthread.php before this query?
here is my first few lines of my showthread.php:

PHP Code:

<?php

error_reporting
(7);
if ( isset(
$goto) and ($goto=='lastpost' or $goto=='newpost')) {
  
$noheader=1;
}
//$leaderboard = $DB_site->query("SELECT userid FROM arcade WHERE game = 'tetris
' ORDER BY score DESC");
//$kingid = $leaderboard['
userid'];

// words to highlight from the search engine

I commented out your code cause it causes the error right now.

Lesane 08-15-2002 04:42 PM

You need to global the function: "$DB_site".

John 08-15-2002 04:43 PM

You heard the man - do it!

Lesane 08-15-2002 04:47 PM

Or use a normal query:

PHP Code:

$leaderboard mysql_query("SELECT userid FROM arcade WHERE game = 'tetris' ORDER BY score DESC") or die("Unable to complete query"); 


kypdurron 08-15-2002 04:47 PM

well...if I do that (like I mentioned a bunch of posts ago), I get
a blank page...

I do an include("global.php");
is that what you meant?
:confused:

michealo 08-15-2002 04:56 PM

Quote:

Database error in vBulletin Control Panel 2.2.1:

Invalid SQL: $award = mysql_query("SELECT userid FROM arcade WHERE game = 'tetris' ORDER BY score DESC") or die("Unable to complete query");
mysql error: You have an error in your SQL syntax near '$award = mysql_query("SELECT userid FROM arcade WHERE game = 'tetris' ORDER BY s' at line 1

mysql error number: 1064

Date: Thursday 15th of August 2002 11:07:01 AM
Script: http://www.psx2central.com/forums/fo...dmin/query.php
Referer: http://www.psx2central.com/forums/ad...p?action=enter
i get this error when running that thry mySQl query
:(

kypdurron 08-15-2002 05:03 PM

I did what you suggested, and I get:

unable to complete query.

can you just post the first few lines of your showthreads.php.

Was this file changed between vb2.2.5 and vb2.2.6?

Just wondering..

Kars10 08-15-2002 05:07 PM

Quote:

Originally posted by JohnWarwick
michealo and Minifreunde -

Change
#########################

$leaderboard = $DB_site->query_first

#########################

to
#########################
$leaderboard = $DB_site->query
#########################

And tell me if it works

Hello John, i test it....but the same Error!! :(

Lesane 08-15-2002 05:38 PM

John, why do you place that query in showthread.php? U could also put it by the rest. If you put it by the rest then $DB_site is already globalised.

admin/functions.php:

find:

PHP Code:

$datecut time() - $cookietimeout

Put after it:

PHP Code:

// King of Tetris Hack, by John Warwick
    
$leaderboard $DB_site->query_first('SELECT userid FROM arcade WHERE game = "tetris" ORDER BY score DESC');
$kingid $leaderboard['userid'];
    if (
$post[userid] == $kingid) {
    
$crown '<img src="https://vborg.vbsupport.ru/images/crown.gif" alt="King of Tetris!" />';
} else {
    
$crown '';



DestyNova 08-15-2002 05:55 PM

Lesane, I didnt try JohnW's instruction yet but I try your suggestion and I got this error:

PHP Code:

Fatal errorCall to a member function on a non-object in C:\Network\Apache2\htdocs\test\admin\functions.php on line 72 

I didnt edit showthread. php yet

DestyNova 08-15-2002 05:57 PM

I edit the showthread and error is same (function error)

DestyNova 08-15-2002 05:59 PM

Sorry for post three times but I try JohnW and it works ??

michealo 08-15-2002 06:14 PM

i tried both methods (JW and lesane's above code) and get the same error

John 08-15-2002 06:49 PM

Quote:

Originally posted by Lesane
John, why do you place that query in showthread.php? U could also put it by the rest. If you put it by the rest then $DB_site is already globalised.
[/php]

Chen said to!

Kars10 08-15-2002 07:07 PM

I test both versions. The Code frome Lesane built the same error in showthread!! :confused:

John 08-15-2002 07:40 PM

To be honest with you, I'm losing the plot of this thread. I don't know who this works for and who it doesn't work for.

So far, most people with problems are on vB 2.2.5 - if you are having problems with this hack, you can find me on MSN under the username of "John@eovie.com"

Mr_P 08-15-2002 08:28 PM

Wll dont lose plot m8 it works fine on 2.2.6 and im a novice by all standards and i pulled it off eventually.

All in all top thanks to all involved.

Kars10 08-15-2002 08:49 PM

I meet you in Msn! :)

DestyNova 08-15-2002 08:53 PM

Um John.evoie, are you JohnW?

Lesane 08-15-2002 09:05 PM

Quote:

Originally posted by Lesane
John, why do you place that query in showthread.php? U could also put it by the rest. If you put it by the rest then $DB_site is already globalised.

admin/functions.php:

find:

PHP Code:

$datecut time() - $cookietimeout

Put after it:

PHP Code:

// King of Tetris Hack, by John Warwick
    
$leaderboard $DB_site->query_first('SELECT userid FROM arcade WHERE game = "tetris" ORDER BY score DESC');
$kingid $leaderboard['userid'];
    if (
$post[userid] == $kingid) {
    
$crown '<img src="https://vborg.vbsupport.ru/images/crown.gif" alt="King of Tetris!" />';
} else {
    
$crown '';



I just tested the code above for the 2nd time on a clean vbulletin and it works like a charm! :banana:

Schorsch 08-16-2002 01:19 AM

hi,

installed after john's installation guide, seems to work fine :banana: thanks john !!

@you guys with the error message, when exactly does this error appear ?

Ryangel 08-16-2002 02:26 AM

hmm crown does not show. *starts looking at code again ..*


All times are GMT. The time now is 10:20 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.01319 seconds
  • Memory Usage 1,829KB
  • 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
  • (7)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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