vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   User Titles (https://vborg.vbsupport.ru/showthread.php?t=39569)

Sigon 06-07-2002 01:09 PM

User Titles
 
Ok well I know at my forums a lot of people are always asking when their user title is going to change to the next one and how many posts it takes to get to each level. So what I was thinking if anyone could do this. Would be to create a hack that on a seperate page (like the newsportal,shoutbox kind of pages) list the different user titles. How many posts it takes to get to each one and maybe how many users are at each level.
This would be very cool for my users and I would defo beta test it for whoever makes it. Thanks!

Admin 06-07-2002 01:20 PM

I *think* this has already been done, have you searched? :)

Sigon 06-07-2002 06:00 PM

yeah I will search again though

Dean C 06-07-2002 06:04 PM

i can't remember this being done :s

Sigon 06-07-2002 06:05 PM

I just searched and found nothing. I think this would help out a lot pf people.

Xenon 06-07-2002 06:06 PM

i'd say like firefly: i think this has been done, but i can't find it now :)

but if not, it wouldn't be hard to write, just a few lines, and then add it to the avatar list

Sigon 06-07-2002 06:09 PM

Add it to the Avatar list? I do not want it in the avatar section I could care less about the avatars. I was thinking a seperate page for them

Xenon 06-07-2002 06:19 PM

where you'll put it, is your problem *gg*

i'd do it myself to the list of the avatars, but, if you want it on a new page, this won't be a problem.

just create a (very) small php file and a template, and it'll work

Sigon 06-07-2002 06:29 PM

I might like your idea. Are you going to do this?

Xenon 06-07-2002 06:57 PM

ok, will do it :)

Sigon 06-07-2002 07:09 PM

Awesome! If you need any help let me know!

Sigon 06-07-2002 07:09 PM

btw I am actually installing the archive hack now

Xenon 06-07-2002 07:13 PM

1 Attachment(s)
:)
i like to hear that :)

ok, the code is written, but ther is no design, make it like you want it :)

template showtitles:
Code:

{htmldoctype}
<html>
<head><title>$bbtitle - Titles</title>
$headinclude
</head>
<body>
$header

<table><tr><td>Min Posts</td><td>Usertitle</td></tr>
$titletext
</table>
$footer

</body>
</html>

and upload this file

Sigon 06-07-2002 08:08 PM

Nice work m8! I am going to customize it a bit but great work! Thanks much!

Xenon 06-07-2002 09:42 PM

you're welcome :)

Chris M 06-07-2002 11:37 PM

Cool hack!

Satan

Xenon 06-08-2002 12:31 PM

thanks ;)

Chris M 06-08-2002 02:13 PM

Your welcome;)

How would you edit this to find out about Avatars?

Satan

Boofo 06-08-2002 03:32 PM

I need to have the User Title and Minimum Posts as two sparate variables in the titles.php without any formatting whatsoever in the php file, can it be done? Please? :)

Quote:

Originally posted by Xenon
:)
i like to hear that :)

ok, the code is written, but ther is no design, make it like you want it :)

template showtitles:
Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><title>$bbtitle - Titles</title>
$headinclude
</head>
<body>
$header

<table><tr><td>Min Posts</td><td>Usertitle</td></tr>
$titletext
</table>
$footer

</body>
</html>

and upload this file


Xenon 06-08-2002 03:53 PM

you'll have a problem: since you don't know how much titles you have, you can't make dynamic variables because in the templates you cannot make a loop to call them all.
you maust make a small sort of formating, or you make your template hardcoded to 3 or 4 or whatever count of your titles..

but if you want to do so:
replace this
PHP Code:

$titletext="";
  while(
$title=$DB_site->fetch_array($titles)) {
    
$titletext.="<tr><td>".$title[minposts]."</td><td>".$title[title]."</td></tr>";
  } 

with this:
PHP Code:

$counter=0;
  while(
$title=$DB_site->fetch_array($titles)) {
    
$titletext[$counter]=$title[title];
    
$titleposts[$counter]=$title[minposts];
    
$counter++;
  } 

then you can user $titletext[x] and $titleposts[x] in your templates

Boofo 06-08-2002 04:18 PM

I did what you said here and put a 3 in for the x part of it (because I have 3 titles at present) but nothing shows up for the titles or minimum posts. Any ideas? I'm using the showtitles template and it doesn't show anything for those 2 variables in there.

Quote:

Originally posted by Xenon
you'll have a problem: since you don't know how much titles you have, you can't make dynamic variables because in the templates you cannot make a loop to call them all.
you maust make a small sort of formating, or you make your template hardcoded to 3 or 4 or whatever count of your titles..

but if you want to do so:
replace this
PHP Code:

$titletext="";
  while(
$title=$DB_site->fetch_array($titles)) {
    
$titletext.="<tr><td>".$title[minposts]."</td><td>".$title[title]."</td></tr>";
  } 

with this:
PHP Code:

$counter=0;
  while(
$title=$DB_site->fetch_array($titles)) {
    
$titletext[$counter]=$title[title];
    
$titleposts[$counter]=$title[minposts];
    
$counter++;
  } 

then you can user $titletext[x] and $titleposts[x] in your templates


Xenon 06-08-2002 04:48 PM

look at the counter variable it starts at 0, so if you have 3 titles you must choose 2 for title nr.3 *gg*

or put the line $counter++ two lines upper

Boofo 06-08-2002 06:33 PM

I put the counter line two lines up and it works great! Thank you very much. When I get the page done, I will put a link to it for you to check out. :) Thanks again!

Quote:

Originally posted by Xenon
look at the counter variable it starts at 0, so if you have 3 titles you must choose 2 for title nr.3 *gg*

or put the line $counter++ two lines upper



All times are GMT. The time now is 04:50 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.01164 seconds
  • Memory Usage 1,771KB
  • 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_code_printable
  • (4)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (23)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