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)
-   -   Member of the Day! (https://vborg.vbsupport.ru/showthread.php?t=34779)

Djidane Tribal 05-26-2003 02:40 PM

<a href="http://foros.animeko.com.mx/memberofday" target="_blank">http://foros.animeko.com.mx/memberofday</a>[1].hack.php

What Happen !

reismarktq2 06-19-2003 06:45 PM

I'm trying to figure out the code necessary to make the words "Member of the Day" appear in the postbit of the MOTD, and I'd appreciate a little help...

I know the code needs to go somewhere in showthread.php. I'm not sure exactly where in the file it should go, but at the very least, I know it needs to start with the same code that the index.php uses:
Code:

$getdaytemplate=$DB_site->query_first("SELECT template FROM template WHERE title='memberoftheday' AND templatesetid=-2");
$daytemplate=$getdaytemplate['template'];
$daybits=explode('||vb||',$daytemplate);

The next logical step from there would be an if statement that would run if $daybits[1] and the poster ID (what would the variable be?) matched up. That would be followed by a line establishing the variable $motd with the HTML code (properly slashed, of course) I want. Once that's done, then put $motd in the postbit template where I want it to go.

Can someone help make this vision work? I love the idea for the hack but I don't want to install it if I can't have this postbit thing... Boofo?

NexDog 06-19-2003 09:55 PM

You're trying to make it so that when a member is Member of the Day, it says so in that member's postbit? That would be pretty cool. :)

reismarktq2 06-24-2003 07:27 PM

I figured it out!

Click here to see...

:)

Boofo 06-24-2003 08:02 PM

How many queries will that add, though? Won't it add a query for each member?

reismarktq2 06-24-2003 08:43 PM

Ooo... yeah, you're right, Boofo. Is there some other way I can code it so that it'll only perform one query?

Boofo 06-24-2003 08:51 PM

I'm not really sure how to pull this one off. Give me some time to see what I can come up with. ;)

reismarktq2 06-24-2003 09:09 PM

Never mind... I figured something out myself. :) Here's what I did... (This assumes you have it installed.)

1. Run the following query:
Quote:

ALTER TABLE user ADD motd SMALLINT(6) DEFAULT '0' NOT NULL;
2. Find this comment in index.php:
Quote:

/* This template is either outdated or the admin wants to reset it.
Either way, we need to choose a new member of the day. Aren't you excited?! */
Add directly below it:
Code:

$DB_site->query("UPDATE user SET motd='0' WHERE userid=$daybits[1]");
3. Still in index.php, find:
Code:

$DB_site->query("UPDATE template
                        SET template='".addslashes($newtemplate)."'
                      WHERE templatesetid=-2
                        AND title='memberoftheday'");

Add directly below it:
Code:

$DB_site->query("UPDATE user SET motd='1' WHERE userid=$newmember[userid]");
4. In admin/functions.php, find:
Code:

eval("\$post[profile] = \"".gettemplate("postbit_profile")."\";");
Add directly ABOVE it:
Code:

if ($post[motd]) {
$motd = "<smallfont><b>Member of the Day!</b></smallfont><br>";
}

5. Add $motd to your postbit template.

This not only adds two queries to the home page (which is not good, but better than 25+ more queries on each showthread page) but it allows the Member of the Day to be recorded as a variable in the user table. This might be useful if, say for instance, one wanted to have multiple Members of the Day for some reason. :)

Boofo 06-24-2003 09:15 PM

What? Now I'm interested in what I missed. ;)

NexDog 06-24-2003 10:41 PM

Does this work?


All times are GMT. The time now is 07:27 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.01600 seconds
  • Memory Usage 1,740KB
  • 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
  • (6)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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