PDA

View Full Version : style name in postbit 0.3


Dream
07-10-2005, 10:00 PM
this is my implementation of the hack used here that shows what style each one is using under their usernames

it will only show the style if the user chose something else then "default style" in the usercp.

also this wont show styles choosen with the "quick style chooser", because those are stored in cookies and not in the database. if you logoff your style is resetted to the one in the usercp.

Installation
- Upload and activate "style name in postbit.xml" plugins
- Put this where you want it to appear

<if condition="$post['styleid'] != 0"><div class="smallfont">Style: <a href="{$GLOBALS[vbulletin]->scriptpath}&styleid=$post[styleid]">$post[styletitle]</a></div></if>
works with: beta 3, beta 4

mholtum
07-13-2005, 11:30 PM
Easy money thanks!

Chris M
07-13-2005, 11:53 PM
Instead of it re-directing to index.php, do you think you could make it so it re-loads the thread? ;)

Satan

Dream
07-13-2005, 11:57 PM
*YAWN*

ill see what I can do. im thinking of changing it so it will only show styles for people that does not use the default one (ie. style 0, if you choose the default style in the usercp it shows)

im a little worried with that require_once() too, its called for each construct_postbit, not sure the performance implications of that

SlaPPiE
07-14-2005, 02:15 AM
Is there a way to port this to where it shows the info in the profile? I feel that's a more appropriate place for such a minor detail on a user.

Chris M
07-14-2005, 11:32 AM
*YAWN*

ill see what I can do. im thinking of changing it so it will only show styles for people that does not use the default one (ie. style 0, if you choose the default style in the usercp it shows)

im a little worried with that require_once() too, its called for each construct_postbit, not sure the performance implications of that
On a large thread I think this potentially could slow performance alot :(

Is there any way you can require /includes/adminfunctions_template.php earlier on in the code, i.e. when showthread is initialised? This might stop it having to be called for every post...

Satan

Dream
07-14-2005, 10:52 PM
On a large thread I think this potentially could slow performance alot :(

Is there any way you can require /includes/adminfunctions_template.php earlier on in the code, i.e. when showthread is initialised? This might stop it having to be called for every post...

Satan

done, download the zip again, remove the old plugin and import the new ones

it seems to be a little faster but I didnt test with microstats

==========================================

0.3 links to the current thread, and only shows the style if the user didnt choose "default style" in the usercp.

if you installed the old one you have to edit the templates again.

==========================================

and here is the old version that shows the style of all users

<div class="smallfont">Style: <a href="{$GLOBALS[vbulletin]->scriptpath}&styleid=$post[styleid]">$post[styletitle]</a></div>

theArchitect
07-17-2005, 02:12 AM
I have just noticed a small bug. If you use quick reply then the AJAX system doesn't pull the style name down. Once you do a hard reload of the page all is ok. Just not when the new post is added via AJAX.

Dream
07-19-2005, 07:37 PM
im discontinuing this one cause it adds a query to showthread.php, and thats not a good place to add queries as its a very requested script. anyone have my permission to develop it from here.

you can use this one instead that adds the style to the user's profile (https://vborg.vbsupport.ru/showthread.php?t=92512)

theArchitect
07-19-2005, 10:57 PM
im discontinuing this one cause it adds a query to showthread.php, and thats not a good place to add queries as its a very requested script. anyone have my permission to develop it from here.

you can use this one instead that adds the style to the user's profile (https://vborg.vbsupport.ru/showthread.php?t=92512)

My board is still very small, so it is not too much of a problem. But I can see it becoming one. But thanks for your work anyway.

Andreas
10-03-2005, 07:48 PM
Idea to avoid the query caused by cache_styles:

showthread_start

foreach ($vbulletin->stylecache AS $parentid => $parentstyles)
{
foreach ($parentstyles AS $displayorder => $styles)
{
foreach ($styles AS $idx => $selstyle)
{
$stylecache["$selstyle[styleid]"] =& $vbulletin->stylecache["$parentid"]["$displayorder"]["$idx"];
}
}
}

Cyricx
10-04-2005, 04:46 PM
Better yet

Use this plugin in showthread_query


$hook_query_fields .= ",style.title";
$hook_query_joins .= " LEFT JOIN style AS style ON(user.styleid = style.styleid)";


Then in the postbit template just do


<if condition="$post['styleid'] != 0"><div class="smallfont">Style:
$post[title]
</div></if>


That's working for me now. Going to toy with it a bit more to clean it up and make it a clickable link that will change the style of the user and such, but that seems to be a good skeleton. :p

EDIT - okay, it needs a lil bit of tweaking LOL, in PMs it shows your style as the title of the pm hehehee.

murrtex
10-19-2005, 03:54 AM
Better yet

Use this plugin in showthread_query


$hook_query_fields .= ",style.title";
$hook_query_joins .= " LEFT JOIN style AS style ON(user.styleid = style.styleid)";


Then in the postbit template just do


<if condition="$post['styleid'] != 0"><div class="smallfont">Style:
$post[title]
</div></if>


That's working for me now. Going to toy with it a bit more to clean it up and make it a clickable link that will change the style of the user and such, but that seems to be a good skeleton. :p

EDIT - okay, it needs a lil bit of tweaking LOL, in PMs it shows your style as the title of the pm hehehee.

can u tell how can i apply your codes,thanks

Cyricx
10-26-2005, 12:06 AM
Murrtex, mine doesn't work at all, causes alot of bugs :), was a good idea but bad application :)

I'm going to try Andreas code :)

Cyricx
10-26-2005, 12:13 AM
O awesome! It worked great, no extra queries by what I can tell :)

Just replace the showthread_start plugin with andreas code :)

Thanks Andreas!!

murrtex
10-26-2005, 01:36 AM
ok cyricx..what will we do..fist i'll install style name in postbit 0.3.zip plugin than apply andreas code..can u show me the way? how ?

Cyricx
10-26-2005, 02:02 AM
Admincp -> plugin system -> download / upload plugins

Scroll to the bottom, Click browse, select the xml in the first post, click import

now

admincp -> plugin system -> plugin manager

scroll down to "Hook Location : showthread_start" - "Styles in Postbit" and click Edit for that one.

Replace all the code in the "PHP Plugin Code" box with Andreas code above.

Click save.

Do the template edit.

Tada :)

murrtex
10-29-2005, 12:42 PM
Admincp -> plugin system -> download / upload plugins

Scroll to the bottom, Click browse, select the xml in the first post, click import

now

admincp -> plugin system -> plugin manager

scroll down to "Hook Location : showthread_start" - "Styles in Postbit" and click Edit for that one.

Replace all the code in the "PHP Plugin Code" box with Andreas code above.

Click save.

Do the template edit.

Tada :)

ok thanks i did it..it works but ...some users ok ,some users no show..??

JoeWho
10-29-2005, 09:38 PM
Murrtex,
Did you get this to work, I have Replace all the code in the "PHP Plugin Code" box with Andreas code but still can not see the style.

JoeWho

murrtex
10-29-2005, 11:13 PM
same on me JoeWho..it works on some user,it doesnt work on some user. :(

goblues
11-05-2005, 11:41 AM
same on me JoeWho..it works on some user,it doesnt work on some user. :(

I think it is only designed to show if the user selected a different style than default. Also, it won't show by using the quick style changer, the user has to change the style in their profile. Someone correct me if I am wrong.

Dave Rosteck
11-06-2005, 03:24 AM
I think it is only designed to show if the user selected a different style than default. Also, it won't show by using the quick style changer, the user has to change the style in their profile. Someone correct me if I am wrong.That's correct.

Can someone tell me how to get the style to show in PMs? It shows 'Style:' but not the actual style name. Thanks in advance.

Holidazed
11-29-2005, 04:08 PM
This is pretty good. However, it only shows what style the user has selected in their UserCP. It does not register if the user changed styles in the pull-dowqn list outside of the UserCP.

Ideas?

Cyricx
12-16-2005, 01:12 PM
I don't think you can show what they picked in the quick style chooser, as that choice is saved in that computers cookies and nowhere on the site.

That's why if your at home and select a style through the chooser, and then go to a different computer, like at work, you have to reselect the style there too is that it's only saved in your cookies.

chimaira
12-17-2005, 08:26 PM
i want to put this... underneath the avatar etc..
as i have all the posts/threads/rep on the right...
and avatar and user title on the left

which template do i edit to put it on the left hand side? ty for help given

weitalia
12-29-2005, 06:25 PM
Great hack!!! Wow i love it ;) And it works perfect...
Just if you want show Default Style too, in postbit use:

<div>$vbphrase[style]: <a href="{$GLOBALS[vbulletin]->scriptpath}&styleid=$post[styleid]"><if condition="$post['styleid'] == 0">Default Style<else />$post[styletitle]</if></a></div>


;)

Blackhat
01-05-2006, 11:13 AM
Can this be fixed so I can use it in memberinfo ?

Pheno
01-05-2006, 05:52 PM
Could it be fixed too with the announcements please ?

Cle
01-15-2006, 08:21 PM
Nice hack! Is there any way that the Default Style set in vBulletin Options --> Style & Language Settings will be displayed for the styleid = 0, instead of making it disappear?

Invalid ID
04-21-2006, 05:11 AM
Hi Dream,
I am not very good at it, so please elaborate in which file and where (specifically) I should put this text:


<if condition="$post['styleid'] != 0"><div class="smallfont">Style: <a href="{$GLOBALS[vbulletin]->scriptpath}&styleid=$post[styleid]">$post[styletitle]</a></div></if>


I would like to see the result above the Messengers icon of the member's profile.

Thank you.

tipoboy
04-21-2006, 01:21 PM
go to your admincp->styles + templates and open your postbit or postbit_legacy which ever you use

search for

<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon]</div>


and above add

<if condition="$post['styleid'] != 0"><div class="smallfont">Style: <a href="{$GLOBALS[vbulletin]->scriptpath}&styleid=$post[styleid]">$post[styletitle]</a></div></if>


this should put your style field above the im icons

Invalid ID
04-21-2006, 02:42 PM
I have both, postbit and postbit_legacy, but I could not find the following text in neither of them:

<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon]</div>

tipoboy
04-24-2006, 12:24 AM
try looking for this
<if condition="$show['reputation']"><if condition="$show['reppower']">$vbphrase[reppower]: $post[reppower] </if><div>$post[reputationdisplay]</div></if>

and placing this AFTER

<if condition="$post['styleid'] != 0"><div class="smallfont">Style: <a href="{$GLOBALS[vbulletin]->scriptpath}&styleid=$post[styleid]">$post[styletitle]</a></div></if>N

Invalid ID
04-24-2006, 11:13 AM
Thanks a lot tipoboy for your reply. I did just what you said but still no result.

Please check your code ended with "N", which I didn't include assuming it could be e typo.

tipoboy
04-24-2006, 02:27 PM
sorry the "N" was a typo!!

i'm running this with 3.5.3 perfectly, what version of vb are you using??

Invalid ID
04-25-2006, 03:04 PM
The latest one, just bought it 2 weeks ago.

tipoboy
04-25-2006, 03:21 PM
ok try going into your style and opening up your postbit/postbit_legacy templates and do a searc for 'msn' and follow the code back to where you see <div>$post
and before that enter the code
screenshot attached + pm sent regarding IM

saba
04-25-2006, 09:38 PM
screen shot pleae

Invalid ID
04-26-2006, 04:54 PM
Just did that again and still no use :)

<!-- post #$post[postid] -->
<if condition="$show['spacer']">
$spacer_open
<div id="edit$post[postid]" style="padding:0px 0px $stylevar[cellpadding]px 0px">
<if condition="!$post['islastshown']"><!-- this is not the last post shown on the page --></if>
</if>


<table class="tborder" id="post$post[postid]" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" $post[scrolltothis]>
<div class="normal" style="float:$stylevar[right]">
&nbsp;
<if condition="$show['postcount']">#<a href="showpost.php?$session[sessionurl]p=$post[postid]&amp;postcount=$post[postcount]" target="new" rel="nofollow" id="postcount$post[postid]" name="$post[postcount]"><strong>$post[postcount]</strong></a> &nbsp;</if>
<if condition="$show['reputationlink']"><a href="reputation.php?$session[sessionurl]p=$post[postid]" rel="nofollow"><img class="inlineimg" src="$stylevar[imgdir_button]/reputation.gif" alt="<phrase 1="$post[username]">$vbphrase[add_to_xs_reputation]</phrase>" border="0" /></a> &nbsp;</if>
<if condition="$show['reportlink']"><a href="report.php?$session[sessionurl]p=$post[postid]" rel="nofollow"><img class="inlineimg" src="$stylevar[imgdir_button]/report.gif" alt="$vbphrase[report_bad_post]" border="0" /></a> &nbsp;</if>
$post[iplogged]
<if condition="$show['inlinemod']">
<input type="checkbox" name="plist[$postid]" id="plist_$postid" style="vertical-align:middle; padding:0px; margin:0px 0px 0px 5px" value="$post[checkbox_value]" onclick="inlineMod.toggle(this)" />
</if>
</div>

<div class="normal">
<!-- status icon and date -->
<a name="post$post[postid]"><img class="inlineimg" src="$stylevar[imgdir_statusicon]/post_$post[statusicon].gif" alt="$post[statustitle]" border="0" /></a>
<if condition="!$show['announcement']">
$post[postdate]<if condition="!$show['detailedtime']">, $post[posttime]</if>
<else />
<phrase 1="$post[startdate]" 2="$post[enddate]">$vbphrase[x_until_y]</phrase>
</if>
$post[firstnewinsert]
<!-- / status icon and date -->
</div>
</td>
</tr>
<tr>
<td class="alt2" style="padding:0px">
<!-- user info -->
<table cellpadding="0" cellspacing="$stylevar[cellpadding]" border="0" width="100%">
<tr>
<if condition="$show['avatar']"><td class="alt2"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if>
<td nowrap="nowrap">

<div id="postmenu_$post[postid]">
<if condition="$show['profile']">
<a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
$post[onlinestatus]
<script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script>
<else />
$post[musername]
</if>
</div>

<if condition="$post['usertitle']"><div class="smallfont">$post[usertitle]</div></if>
<if condition="$post['rank']"><div class="smallfont">$post[rank]</div></if>

</td>
<td width="100%">&nbsp;</td>
<td valign="top" nowrap="nowrap">

<div class="smallfont">
<if condition="$post['joindate']"><div>$vbphrase[join_date]: $post[joindate]</div></if>
<if condition="$post['field2']"><div>$vbphrase[location_perm]: $post[field2]</div></if>
<if condition="$post['age']"><div>$vbphrase[age]: $post[age]</div></if>
<div>
$vbphrase[posts]: $post[posts]
</div>
<if condition="$show['reputation']"><if condition="$show['reppower']">$vbphrase[reppower]: $post[reppower] </if><div>$post[reputationdisplay]</div></if>

<if condition="$post['styleid'] != 0"><div class="smallfont">Style: <a href="{$GLOBALS[vbulletin]->scriptpath}&styleid=$post[styleid]">$post[styletitle]</a></div></if>

<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</div>
</div>

</td>
</tr>
</table>
<!-- / user info -->
</td>
</tr>
<tr>
<td class="alt1" id="td_post_$post[postid]">
<!-- message, attachments, sig -->

<if condition="$show['messageicon'] OR $post['title']">
<!-- icon and title -->
<div class="smallfont">
<if condition="$show['messageicon']"><img class="inlineimg" src="$post[iconpath]" alt="$post[icontitle]" border="0" /></if>
<if condition="$post['title']"><strong>$post[title]</strong></if>
</div>
<hr size="1" style="color:$stylevar[tborder_bgcolor]" />
<!-- / icon and title -->
</if>

<!-- message -->
<div id="post_message_$post[postid]">$post[message]</div>
<!-- / message -->

<if condition="$show['attachments']">
<!-- attachments -->
<div style="padding:$stylevar[cellpadding]px">

<if condition="$show['thumbnailattachment']">
<fieldset class="fieldset">
<legend>$vbphrase[attached_thumbnails]</legend>
<div style="padding:$stylevar[formspacer]px">
$post[thumbnailattachments]
</div>
</fieldset>
</if>

<if condition="$show['imageattachment']">
<fieldset class="fieldset">
<legend>$vbphrase[attached_images]</legend>
<div style="padding:$stylevar[formspacer]px">
$post[imageattachments]
</div>
</fieldset>
</if>

<if condition="$show['imageattachmentlink']">
<fieldset class="fieldset">
<legend>$vbphrase[attached_images]</legend>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
$post[imageattachmentlinks]
</table>
</fieldset>
</if>

<if condition="$show['otherattachment']">
<fieldset class="fieldset">
<legend>$vbphrase[attached_files]</legend>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
$post[otherattachments]
</table>
</fieldset>
</if>

<if condition="$show['moderatedattachment']">
<fieldset class="fieldset">
<legend>$vbphrase[attachments_pending_approval]</legend>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
$post[moderatedattachments]
</table>
</fieldset>
</if>

</div>
<!-- / attachments -->
</if>

<if condition="$post['signature']">
<!-- sig -->
<div>
__________________<br />
$post[signature]
</div>
<!-- / sig -->
</if>

<if condition="$show['postedited']">
<!-- edit note -->
<div class="smallfont"> <hr size="1" style="color:$stylevar[tborder_bgcolor]" />
<em>
<phrase 1="$post[edit_username]" 2="$post[edit_date]" 3="$post[edit_time]">$vbphrase[last_edited_by_x_on_y_at_z]</phrase>.
<if condition="$post['edit_reason']">$vbphrase[reason]: $post[edit_reason]</if>
</em>
</div>
<!-- / edit note -->
</if>

<div align="$stylevar[right]">
<!-- controls -->
<if condition="$post['editlink']">
<a href="$post[editlink]" name="vB::QuickEdit::$post[postid]"><img src="$stylevar[imgdir_button]/edit.gif" alt="$vbphrase[edit_delete_message]" border="0" /></a>
</if>
<if condition="$post['forwardlink']">
<a href="$post[forwardlink]"><img src="$stylevar[imgdir_button]/forward.gif" alt="$vbphrase[forward_message]" border="0" /></a>
</if>
<if condition="$post['replylink']">
<a href="$post[replylink]" rel="nofollow"><img src="$stylevar[imgdir_button]/<if condition="$post['forwardlink']">reply_small<else />quote</if>.gif" alt="$vbphrase[reply_with_quote]" border="0" /></a>
</if>
<if condition="$show['quickreply'] AND !$show['threadedmode']">
<a href="$post[replylink]" rel="nofollow" id="qr_$post[postid]" onclick="return false"><img src="$stylevar[imgdir_button]/quickreply.gif" alt="$vbphrase[quick_reply_to_this_message]" border="0" /></a>
</if>
<if condition="$show['moderated']">
<img src="$stylevar[imgdir_misc]/moderated.gif" alt="$vbphrase[moderated_post]" border="0" />
</if>
<!-- / controls -->
</div>

<!-- message, attachments, sig -->

</td>
</tr>
</table>

<!-- post $post[postid] popup menu -->
<div class="vbmenu_popup" id="postmenu_$post[postid]_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr>
<td class="thead">$post[username]</td>
</tr>
<if condition="$show['profile']">
<tr><td class="vbmenu_option"><a href="member.php?$session[sessionurl]u=$post[userid]">$vbphrase[view_public_profile]</a></td></tr>
</if>
<if condition="$show['pmlink']">
<tr><td class="vbmenu_option"><a href="private.php?$session[sessionurl]do=newpm&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">$vbphrase[send_private_message_to_x]</phrase></a></td></tr>
</if>
<if condition="$show['emaillink']">
<tr><td class="vbmenu_option"><a href="sendmessage.php?$session[sessionurl]do=mailmember&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">$vbphrase[send_email_to_x]</phrase></a></td></tr>
</if>
<if condition="$show['homepage']">
<tr><td class="vbmenu_option"><a href="$post[homepage]"><phrase 1="$post[username]">$vbphrase[visit_xs_homepage]</phrase></a></td></tr>
</if>
<if condition="$show['search']">
<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=finduser&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">$vbphrase[find_all_posts_by_x]</phrase></a></td></tr>
</if>
<if condition="$post['userid'] AND $show['member']">
<tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=addlist&amp;userlist=buddy&amp;u=$post[userid]"><phrase 1="$post[username]">$vbphrase[add_x_to_buddy_list]</phrase></a></td></tr>
</if>
</table>
</div>
<!-- / post $post[postid] popup menu -->




<if condition="$show['spacer']">
</div>
$spacer_close
</if>
<!-- / post #$post[postid] -->


I have added you on MSN. Really appreciate the way you are helping. :)

ZombieAndy
04-26-2006, 05:19 PM
you guys do know you could just modify the postbit template and add

<if condition="$post['styleid']= 0"><div class="smallfont">Style:
Your Style 1</div></if>
<if condition="$post['styleid']= 0"><div class="smallfont">Style:
Your Style 2</div></if>
<if condition="$post['styleid']= 0"><div class="smallfont">Style:
Your Style 3</div></if>


without any plugins, and it would do exactly the same thing. its really not healthy to use unnesscary plugins on a forum as it adds extra strain to your server and database, especially on larger forums or forums with alot of plugins where it can slow down page loading to a very annoying pace :)

you should always be avoiding using plug-ins where you can :p

FunaGuy
05-06-2006, 04:56 PM
Install Working*

GreysAnatomy
05-08-2006, 10:50 AM
Took me 2 minutes to install and is working on 3.5.4! Thanks a lot!

Invalid ID
05-08-2006, 06:34 PM
I can see it when I check a member's profile... but I want to see it like we have here, under vB Version.

lexx27
06-18-2006, 02:30 AM
Can someone tell me the right way to install this hack...??

Kmurray
09-07-2006, 02:56 PM
This looks like the code I need, however when using this in my postbits, both skins list on each member... im on vB 3.6


you guys do know you could just modify the postbit template and add

<if condition="$post['styleid']= 0"><div class="smallfont">Style:
Your Style 1</div></if>
<if condition="$post['styleid']= 0"><div class="smallfont">Style:
Your Style 2</div></if>
<if condition="$post['styleid']= 0"><div class="smallfont">Style:
Your Style 3</div></if>


without any plugins, and it would do exactly the same thing. its really not healthy to use unnesscary plugins on a forum as it adds extra strain to your server and database, especially on larger forums or forums with alot of plugins where it can slow down page loading to a very annoying pace :)

you should always be avoiding using plug-ins where you can :p

VitroX
09-23-2006, 02:13 PM
This looks like the code I need, however when using this in my postbits, both skins list on each member... im on vB 3.6

same happens to me on 3.6.1

I have 2 styles and I did this on postbit

<if condition="$post['styleid']= 1"><div class="smallfont">Style:
Style 1</div></if>
<if condition="$post['styleid']= 2"><div class="smallfont">Style:
Style 2</div></if>

but it shows both of them.

Allan
12-12-2006, 12:08 PM
Don't work with vB 3.6.4.

friendfinder.co
06-28-2007, 01:48 AM
dont work with 3.5.4 too

siliconfinance
09-11-2007, 04:24 AM
Anybody get this working with 3.6.8?

nicker
09-30-2007, 08:22 PM
Anybody get this working with 3.6.8?

Yes but I used the 0.2 version that is posted further back in this thread.

TPOCJames
01-24-2008, 01:21 AM
Working with 3.7.

Dream
01-26-2008, 09:23 PM
That's impressive :)