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)
-   -   Custom Postbit for every User (https://vborg.vbsupport.ru/showthread.php?t=43688)

Xenon 09-17-2002 10:00 PM

Custom Postbit for every User
 
After the one Day Beta-Version i've finished the Hack so i can release it now.

Hack Version: 1.20b

Additional Queries in showthread.php: 1

What it does: It gives users the Ability to choose between custom postbits instead of just the one global postbit (or more if you have different styles).
Also it allows users to create their own custom postbits using html-code (These must be validated by an admin before they can use them)
It also gives you the ability to create a postbit just a special usergroup or just a special user can use.

I think i've tested every little option, but if you find a bug please tell me.

Please click install if you use the hack.

Some additions:
in cpostbit.php you find this lines to allow users wether to choose a custom postbit or to create new ones:
// Usergroups which can use custom postbits
$canusecpb="2 5 7 6";
// Usergroups which can create own custom postbits
$cancreatecpb="2 5 7 6";

people who installed the beta version should run installcpb.php?action=unstall&killbeta=1 before installing the hack.

Enjoy
screenshots following

Xenon 09-18-2002 11:57 AM

admin overview

Xenon 09-18-2002 11:57 AM

validate screen

Xenon 09-18-2002 11:58 AM

preview of an unvalidatet postbit + editscreen

Xenon 09-18-2002 11:59 AM

user choose postbit screen

Xenon 09-18-2002 11:59 AM

user add custom postbit

Xenon 09-18-2002 12:00 PM

thread view with different postbits

MarkB 09-18-2002 01:18 PM

I'd be interested in seeing this in action on a live forum (and people's reactions to it:))!

Velocd 09-18-2002 04:11 PM

Wow..this is different than what I thought it was initially, but still looks cool. I thought it would be just like choosing other styles, but postbits for each style.

Anyway, still cool ;)

Vile 09-18-2002 07:02 PM

Ooh, this looks sweet.
Thanks :)

Mystislav 09-19-2002 12:40 AM

Wow, that would end up being pretty complicated but it's cool.

Link14716 09-19-2002 01:13 AM

I installed it, and all is fine but on the cpostbit.php page AND on the admin cpostbit page, the preview just shows the postbit template no matter what the postbit is. Any fix?

Colon33 09-19-2002 06:23 AM

Hey, Like i was saying in the BETA forum. Its not a good idea unless you trust a user to know his HTML well. i mean very well.

You can trust a user not too mess it up on purpose but what happens when they completely botch a customizing job and really screw over your forums for awhile? It has nothing to do with trust people make mistakes. Maybe you should release a version of this where people can change the location and whats displayed but the HTML is SET. Its too much of a risk allowing people to do there own HTML work.

But the idea itself is a great mod to a VB... just i think its way to risky.

Xenon 09-19-2002 09:32 AM

colon i think you didn't understand my hack....
a user cannot use a selfmade custom postbit until it has been validatet by an admin, so the risky thing is that you as an admin would oversee anything...

@Link: Are you sure you have applied the changes to functions.php correctly?
because here at my testboard everything works fine

Xenon 09-19-2002 09:33 AM

Mystislav, please go to this page and enter your username, to show you are licensed. (you will need to use your customer number and password to access that page)
Thank you.


oh and no it's not so complicated as it looks now ;)

Xenon 09-19-2002 02:28 PM

damn triplepost ^^

ok i've released version 1.20
no new features are added but i'd say all of you should update, because it'll reduce query ammount alot (if a user hast posted twice on a page just one query is needed now)

upgradeinfos: you have just to apply the changes in functions.php
then you should apply the changes to showthread.php

and then at the end of getpostbit function apply the changes you can see in cpostbit.txt


With this new Version the query-count increases just by 1 instead of 15 (or how much post per page you had)

vdinh 09-19-2002 10:24 PM

Hi Xenon,
Great hack :) ...

In your version 1.20 instruction:

Quote:

Step 6: edit admin/index.php
----------------------------
after:
if ($moderatenewmembers==1 or $usecoppa==1) {
$waiting=$DB_site->query_first("SELECT COUNT(*) AS users FROM user WHERE usergroupid=4");
if ($waiting[users]==0) {
echo "<font size='1'>There are currently $waiting[users] user(s) awaiting <a href=\"user.php?s=$session[sessionhash]&action=moderate\">moderation</a>.</font>";
} else {
echo "<b><a href=\"user.php?s=$session[sessionhash]&action=moderate\">There are currently $waiting[users] user(s) awaiting moderation</a>.</b>";
}
}

add:
$unvalid=$DB_site->query_first("SELECT COUNT(*) AS number FROM custompostbit WHERE validated=0");
echo "<br><a href=\"admincpb.php?s=$session[sessionhash]&action=validate\">There are currently ".$unvalid[number]." custom postbits to validate!</a><br><br>";

find:
// ***
makenavoption("New Posts","../mod/moderate.php?action=posts","<br>");
makenavoption("New Attachments","../mod/moderate.php?action=attachments");
makenavselect("Moderation","<hr>");

replace with:
// ***
makenavoption("New Posts","../mod/moderate.php?action=posts","<br>");
makenavoption("New Attachments","../mod/moderate.php?action=attachments");
makenavselect("Moderation");
// **
makenavoption("Add","admincpb?action=add","|");
makenavoption("View/Edit/Delete","admincpb?action=view","<br>");
makenavoption("Validate Postbits","admincpb?action=validate","<br>");
makenavselect("Custom Postbits","<hr>");
I think those lines need to add the .php extension before the question makrs :)

Xenon 09-20-2002 12:22 PM

huh?

yes you're right thank you....

but it also works without i think.. (i mean it worked here i just copied the lines out of my index.php) ;)

i've updated the instructions

vdinh 09-20-2002 03:08 PM

Hi Xenon,
I wonder if there is a way to, also, create separate postbit format for a member for each sub-forum. Suppose that my vBulletin forum got 3 rooms, can each of the 3 rooms carry a different postbit format for myself? Thanks.

Xenon 09-20-2002 03:36 PM

well if you've installed this hack you cann edit your showthread.php:
find
PHP Code:

while ($post=$DB_site->fetch_array($posts) and $counter++<$perpage) {

  if (
$postdone[$post[postid]]) {
    
$counter--;
    continue;
  } else {
    
$postdone[$post[postid]]=1;
  }
  
$postbits .= getpostbit($post);


and replace with this:
PHP Code:

while ($post=$DB_site->fetch_array($posts) and $counter++<$perpage) {

  if (
$postdone[$post[postid]]) {
    
$counter--;
    continue;
  } else {
    
$postdone[$post[postid]]=1;
  }
  
$postbitid=0;  
if(
$thread['forumid']==and $post[userid]==y$postbitid=z;
$postbits .= getpostbit($post,$postbitid);


that should do it

vdinh 09-20-2002 03:55 PM

Thanks a lot, Xenon! Finally I figured out what you meant :) It worked like a charm https://vborg.vbsupport.ru/external/2011/01/19.gif

Colon33 09-22-2002 04:16 PM

Quote:

Originally posted by Xenon
colon i think you didn't understand my hack....
a user cannot use a selfmade custom postbit until it has been validatet by an admin, so the risky thing is that you as an admin would oversee anything...

@Link: Are you sure you have applied the changes to functions.php correctly?
because here at my testboard everything works fine


OK. i think i understand. I thought, that you had to validate a user before using it. Not the customization. In that case, its a little more safer. Just one question.

How bad does this lag a board? If at all.

Xenon 09-22-2002 04:43 PM

it adds just one query so the DB queries don't lag a board.
and if the users don't use foreign images then it doesn't lag a board..

Link14716 09-22-2002 09:58 PM

Ok, I figured it out. There was a part of futureal's arcade code in there, I had to switch the position of the code to get it to work ;)

wolfe 09-24-2002 12:34 PM

Xenon m8 is there a way i can make it not show the picture of the default post bit just a option user Default Postbit

and it will only show the pics of the custom postbit i made :D

Xenon 09-24-2002 01:23 PM

you have to edit cpostbit.php:
PHP Code:

  if($bbuserinfo[postbitid]!=0) {
      
$choosetext "<input type=\"radio\" name=\"cpostbit\" value=\"0\"> Use standart";
      
$postbit=getpostbit($post,0);
      eval(
"\$choosebits .= \"".gettemplate('cpostbit_choosebit')."\";");
  } 

not the finest way but try this:
PHP Code:

  if($bbuserinfo[postbitid]!=0) {
      
$choosetext "<input type=\"radio\" name=\"cpostbit\" value=\"0\"> Use standart";
      
$postbit="";
      eval(
"\$choosebits .= \"".gettemplate('cpostbit_choosebit')."\";");
  } 

that should do it

wolfe 09-24-2002 01:34 PM

also there is something wrong i have added a custom postbit

and it goes something like this

Code:

<br>
<table align="center" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="15"><img src="{imagesfolder}/left.gif" border="0"></td>

<td align="center" background="{imagesfolder}/catbg.gif" width="887"><normalfont color="{categoryfontcolor}"><b>$post[title]</b></normalfont></td>

<td width="15"><img src="{imagesfolder}/right.gif" border="0"></td>
</tr>
</table>
<table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextra} width="{contenttablewidth}" align="center"><tr><td>

<DIV id="p$post[postid]h" style="display:$ph">
<table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextra} width="100%">
<tr>
        <td bgcolor="#CFCFCF" width="175" valign="top" nowrap>$plusimg  <font size="4"><b>$post[username]</b></font><br>
$bigstars
$goldstars
$pips<br>
              <smallfont>$post[usertitle]</smallfont></td>
        <td bgcolor="#CFCFCF" width="100%" valign="top">
                <table width="100% cellspacing="0" cellpadding="0" border="0">
                <tr>
                <td><smallfont>$post[icon] <b>$post[title]</b></smallfont></td>
                <td align="right" nowrap><smallfont>$onlinestatus $post[foldericon] $post[postdate] <font color="{timecolor}">$post[posttime]</font></smallfont></td><td width="15%" align="right"> <smallfont>(Post# <a href="showthread.php?postid=$post[postid]#post$post[postid]"><smallfont>$countposts</smallfont></a>)</smallfont></td></tr></table><br><normalfont>$post[shortmsg]</normalfont>
               
</tr>
</table>
</DIV>

<DIV id="p$post[postid]e" style="display:$pe">

<table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextra} width="100%"><tr>

          <td bgcolor="#CFCFCF" width="175" valign="top" nowrap> <a name="post$post[postid]"></a>
            <br>
            <br>

<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0"><font face="verdana,arial,helvetica" size="1"><B>Level: $level | Member ID: $post[userid]</b></font></p>

<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0"><font face="verdana,arial,helvetica" size="1"><B>MP: $maxmp%</font></B></p><table border="1" cellpadding="0" cellspacing="0" width="90%" bordercolor="#000000" bordercolorlight="#000000" bordercolordark="#000000"><tr><td width="100%"><img border="0" src="{imagesfolder}/bar1.gif" width="$maxmp%" height="9"></td>  </tr></table><font face="verdana,arial,helvetica" size="1"><B>HP: $hp%</B><table border="1" cellpadding="0" cellspacing="0" width="90%" bordercolor="#000000" bordercolorlight="#000000" bordercolordark="#000000"><tr><td width="100%"><img border="0" src="{imagesfolder}/bar2.gif" width="$hp%" height="9"></td>  </tr></table><font face="verdana,arial,helvetica" size="1"><B>EXP: $exp%</b><table border="1" cellpadding="0" cellspacing="0" width="90%" bordercolor="#000000" bordercolorlight="#000000" bordercolordark="#000000"><tr><td width="100%"><img border="0" src="{imagesfolder}/bar3.gif" width="$exp%" height="9"></td></tr></table><br>       

<smallfont>
$awaymessage
Registered: $post[joindate]<br>
Location: $post[field2]<br>
Posts: $post[posts] <font color="#00FFFF">[$postsperday Per Day]</font><br>
Board Pounds: $post[storep] $donate<br>
Thread Views: $post[views]<br><br>
</smallfont></td>

          <td bgcolor="CFCFCF" width="100%" valign="top">
            <p><normalfont>$post[firstnewinsert]$minusimg <font size="4"><b>$post[username]</b></font><br>
              $bigstars $goldstars $pips<br>
              <smallfont>$post[usertitle]<br>
              $post[avatar]<br>
              <br>
              <a href='timeonline.php?s=$session[sessionhash]&action=view_leader'><b>Time
              Spent On This Board:</b></a><br>
              $post[onlinetime] </smallfont></normalfont></p>
              $post[attachment]
            <p>$post[signature]</p>
<p>$post[editedby]</p>

            <p align="right"><smallfont></smallfont></p>
            <table border="0" width="100%">
              <tr>
                <td width="85%"> <smallfont>$post[icon] <b>$post[title] </b></smallfont></td>
                <td width="15%" align="right"> <smallfont>(Post# <a href="showthread.php?postid=$post[postid]#post$post[postid]"><smallfont>$countposts</smallfont></a>)</smallfont></td>
              </tr>
            </table>
            <p><br>
              $post[message]</p>
            <p>&nbsp;</p>
            <p>&nbsp;</p>
            <p align="right"> <a href="report.php?s=$session[sessionhash]&postid=$post[postid]">Report
              this post to a moderator</a> | $post[iplogged]<br>
              $post[warnings]</p>
          </td>
        </tr><tr>        <td bgcolor="#CFCFCF" width="175" height="16" nowrap><smallfont>$post[foldericon] $post[postdate] <font color="{timecolor}">$post[posttime]</font></smallfont></td>                <td bgcolor="#CFCFCF" width="100%" valign="middle" height="16"><table width="100%" border="0" cellpadding="0" cellspacing="0">                <tr valign="bottom"><td><smallfont>$post[profile] $post[pmlink] $post[useremail] $post[homepage] $post[search] $post[buddy]$post[icqicon] $post[aimicon] $post[yahooicon] $post[msnicon]</smallfont></td><td align="right" nowrap><smallfont><a href="javascript:showwin('store.php?action=rate&postuserid=$post[userid]&postid=$post[postid]&postusername=$post[username]', 'width=550,height=250')"><img src="{imagesfolder}/storerate.gif" border="0" alt="Rate This Post"></a><a href="editpost.php?s=$session[sessionhash]&action=editpost&postid=$post[postid]"><img src="{imagesfolder}/edit.gif" border="0" alt="Edit/Delete Message"></a><a href="newreply.php?s=$session[sessionhash]&action=newreply&postid=$post[postid]"><img src="{imagesfolder}/quote.gif" border="0" alt="Reply w/Quote"></a></smallfont></td></tr>
</table>       
</td></tr>
</table></td></tr>
</table>
</DIV>
<table align="center" cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="center" width="15"><img src="{imagesfolder}/pbbleft.gif" border="0"></td>

<td align="center" background="{imagesfolder}/postbbg.gif" width="887"></td>

<td align="center" width="15"><img src="{imagesfolder}/pbbright.gif" border="0"></td>
</tr>
</table>

and it is just making the default one what comes with VBB i am using 2.2.7 also when i pick one i made it just still uses the default one i did on the board :( please help

wolfe 09-24-2002 01:36 PM

wtf it just added vbb.org where i had { imagesfolder }

Xenon 09-24-2002 01:40 PM

it shows the postbits correct on the chooserscreen?

be sure you have added correctly every single line to functions.php and showthread.php

normally everything should work, and it works on two of my test boards..

Mathiau 10-01-2002 03:15 AM

wow!

a wicked hack

Question

me, i like things to ALL look the same, so this could make things look "messy" to someone like me.

Would it, if it does not already, have an option, much like a certain template

So, i make my own postbit template and then, when I view forums ALL posbits look like that? OR i can change to say another postbit template and it will look like that? - much the same as u change the color scheme on here... it affects the overall site, nut just what u do.

instead of seeing everyonme diff, postbit - as i can see some people finding that annoying as you get used to something, like profile being in one place, but it is in a few diff. places for diff people....

Just a thought.

but other wiuse very impressive hack!

Xenon 10-01-2002 09:44 AM

hmm you mean users can create and select different postbits but just they can see what they've choosed and all other posts look like their own?

well you can hack my hack a bit to get that effect:
chage this lines:
PHP Code:

        if($postbitid==&& $post[postbitid]==0) {
            eval(
"\$retval = \"".gettemplate("postbit")."\";");
        } else {
            if(
$postbitid==0$postbitid=$post[postbitid]; 

into this:
PHP Code:

        if($postbitid==&& $bbuserinfo[postbitid]==0) {
            eval(
"\$retval = \"".gettemplate("postbit")."\";");
        } else {
            if(
$postbitid==0$postbitid=$bbuserinfo[postbitid]; 

that should do the trick

sonic3d 02-13-2003 03:54 PM

hey xenon after i finish adding a postbit, this comes up

PHP Code:

Custom Postbits 
?x_Vmo?6???7n??:v?4?K??6h?t??}??i??D?$?C??(?z?/?Ķ?r??sw??<)$$Yj c#??Ux???y?????(*.??Y????xھ'? ??,^y???ۏC??z??K??m3p6????\?<?nN6?i?6 x?+p?܋?=????? ,?0??OO????@?;?^?/?yu? IA?Be:b??^?C`?l?????_#eh8X????x??{E??

and nothing happens. did i do something wrong?

l8er
sonic

Xenon 02-13-2003 05:05 PM

hmm, seems like you've done something wrong, but no idea what :)
looks really wierd....

sonic3d 02-13-2003 07:57 PM

well i double checked it and still doesn;t work. i just uninstalled it.

l8er
sonic

Xenon 02-13-2003 08:01 PM

maybe the fileupload was corupted...

sonic3d 02-13-2003 08:08 PM

maybe, i will try it later today and see what happens.

l8er
sonic

dnd 02-17-2003 07:39 PM

hi xenon

I've installed this hack, added a new postbit
but whin i click on " View/Edit/Delete " i can only see the custom postbit with no options to edit or delete

whats wrong?

Xenon 02-17-2003 08:18 PM

@sonic3d: now i got the same error....
don't know the reason, maybe it has to do with the mysql or php version....
/me tries to find out..

@dnd: hmm, wierd
have you installed everything correct?
i can't test it now, as my testserver produces another problem...

Xenon 02-17-2003 08:49 PM

@sonic3d and all others:
gzip compression produces that problem
i've uploaded a new version. there were just changes to admincpb.php so just upload this..

dnd 02-17-2003 09:13 PM

thanks xenon
works great now :)


All times are GMT. The time now is 02:46 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.01657 seconds
  • Memory Usage 1,868KB
  • 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
  • (2)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