Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-06-2013, 05:48 PM
CoffeeLovesYou CoffeeLovesYou is offline
 
Join Date: Feb 2010
Posts: 176
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default User Tags per Row for PMs

Hi,
Thanks to kh99, I currently have a certain number of user tags per row for Posts.
Here is the code I am using for Posts:
Hooked to postbit_display_start
PHP Code:
$rowlen $this->registry->userinfo['field50']; 
if (
$rowlen <= 0)
   
$rowlen 5// default columns

$ranklist explode('<br />'$this->post[rank]);
$this->post[rank] = '';
$col 0;
foreach(
$ranklist as $r)
{
   if (
$col >= $rowlen)
   {
      if (
$this->post[rank] != '')
         
$this->post[rank] .= '<br />';
      
$col 0;
   }
   
$this->post[rank] .= $r;
   
$col++;
}

$this->post[rank] .= "<!-- field50 ='" $this->registry->userinfo['field50'] . "' -->\r\n";
unset(
$col$rowlen$ranklist); 
Now, how can I have the amount of user tags per row for PMs?
Can someone help me alter the code to work in private messages, please, and where to hook the plugin?
Thank you greatly
Reply With Quote
  #2  
Old 04-07-2013, 11:34 PM
CoffeeLovesYou CoffeeLovesYou is offline
 
Join Date: Feb 2010
Posts: 176
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump. Looking for this
Reply With Quote
  #3  
Old 04-09-2013, 06:48 AM
CoffeeLovesYou CoffeeLovesYou is offline
 
Join Date: Feb 2010
Posts: 176
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump
Reply With Quote
  #4  
Old 04-09-2013, 03:47 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

User tags in PMs? I have no idea what tags you are talking about in PMs.
Reply With Quote
  #5  
Old 04-10-2013, 01:31 AM
CoffeeLovesYou CoffeeLovesYou is offline
 
Join Date: Feb 2010
Posts: 176
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
User tags in PMs? I have no idea what tags you are talking about in PMs.
Hi Lynne, thanks for the reply.
You know how you can stack user ranks? Well, our ranks are stacked, however, they are stacked in rows. Right now, it is set 4 ranks per row.
See this pic below:

Anyway, kh99 helped me by providing the code to set the user ranks per row to '2' ranks per row for profiles, as well as '4' ranks per row or user choice for posts.
However, the code I am using for 4 ranks per row for posts does not work for PMs, too.
In PMs, the ranks are stacking all vertically, which looks horrid.
Look here:

So, yeah. $this->post[rank] must not work in Private Msgs. Or I am hooking it to the wrong location. Not sure. Can you help?
Reply With Quote
  #6  
Old 04-10-2013, 01:46 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you tried that on a totally default style? The default style uses the same template for PMs and posts (assuming you are using the postbit_legacy template).
Reply With Quote
  #7  
Old 04-11-2013, 12:34 AM
CoffeeLovesYou CoffeeLovesYou is offline
 
Join Date: Feb 2010
Posts: 176
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Have you tried that on a totally default style? The default style uses the same template for PMs and posts (assuming you are using the postbit_legacy template).
I am using the postbit template, actually, lol. It is just how I took the picture.
None of this code is in a template. This is all done through the plugin system.
Every rank added is set to 'Stack Rank'. This code stacks them in rows. So, if a user has 14 ranks, there will be two rows of 5, and then one row of 4 ranks. I need it to do this for PMs, too. Not sure where to hook my plugin or if anything needs to be changed in the plugin from posts to PMs (look at first PHP code posted)
Reply With Quote
  #8  
Old 04-11-2013, 01:58 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm surprised you need a plugin to show the ranks. But anyway.... if you want to change the code just for the PM page, you may use this condition:
PHP Code:
if (THIS_SCRIPT == 'private') {
rank code without <br /> between all ranks

However, if that code is being used in posts and it is fine, then my guess is this is a CSS issue. The only way to check that out is to be able to view the actual page using a tool like firebug. Are you familiar with that? You may view the CSS and perhaps make a div wider.
Reply With Quote
  #9  
Old 04-13-2013, 10:16 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I see that you put in code to put the value of field50 into an html comment - what are you getting as the value? It looks like maybe the userfields aren't set when it's a pm, but that's kind of surprising because I've seen a lot of people do things in the postbit based on a custom profile field, but I don't remember anyone complaining about it not working in a PM.

Edit: Try changing the hook location to postbit_display_complete.
Reply With Quote
  #10  
Old 04-13-2013, 12:06 PM
CoffeeLovesYou CoffeeLovesYou is offline
 
Join Date: Feb 2010
Posts: 176
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks kh99, that worked (changing the hook to postbit_display_complete)
however, I am trying to use part of Lynne's suggestion so I can make it so in PMs, there are 3 ranks per row, whereas in posts, there are 5 ranks per row;
see here:
PHP Code:
$rowlen $this->registry->userinfo['field50']; 
if (
$rowlen <= 0)
if (
THIS_SCRIPT == 'private') {
$rowlen 3// default columns } else {
   
$rowlen 5// default columns

$ranklist explode('<br />'$this->post[rank]);
$this->post[rank] = '';
$col 0;
foreach(
$ranklist as $r)
{
   if (
$col >= $rowlen)
   {
      if (
$this->post[rank] != '')
         
$this->post[rank] .= '<br />';
      
$col 0;
   }
   
$this->post[rank] .= $r;
   
$col++;
}

$this->post[rank] .= "<!-- field50 ='" $this->registry->userinfo['field50'] . "' -->\r\n";
unset(
$col$rowlen$ranklist); 

and I tried this:
PHP Code:
if (THIS_SCRIPT == 'private')
$rowlen $this->registry->userinfo['field50']; 
if (
$rowlen <= 0)
   
$rowlen 3// default columns

$ranklist explode('<br />'$this->post[rank]);
$this->post[rank] = '';
$col 0;
foreach(
$ranklist as $r)
{
   if (
$col >= $rowlen)
   {
      if (
$this->post[rank] != '')
         
$this->post[rank] .= '<br />';
      
$col 0;
   }
   
$this->post[rank] .= $r;
   
$col++;
}

$this->post[rank] .= "<!-- field50 ='" $this->registry->userinfo['field50'] . "' -->\r\n";
unset(
$col$rowlen$ranklist); 
} else {
$rowlen $this->registry->userinfo['field4111']; 
if (
$rowlen <= 0)
   
$rowlen 5// default columns

$ranklist explode('<br />'$this->post[rank]);
$this->post[rank] = '';
$col 0;
foreach(
$ranklist as $r)
{
   if (
$col >= $rowlen)
   {
      if (
$this->post[rank] != '')
         
$this->post[rank] .= '<br />';
      
$col 0;
   }
   
$this->post[rank] .= $r;
   
$col++;
}

$this->post[rank] .= "<!-- field50 ='" $this->registry->userinfo['field50'] . "' -->\r\n";
unset(
$col$rowlen$ranklist); 

that way, if they are on private, ranks show up 3 per row. if they are on a post/thread, it shows up with 5.
i can't have 5 in PMs as it is stretching the pm display. 3 or maybe 4 will be just enough per row in PMs

EDIT: NVM! I did it! Yay!
Thank you both for the help! Here is the code in postbit_display_complete

PHP Code:
if (THIS_SCRIPT == 'private') {
$rowlen $this->registry->userinfo['field50']; 
if (
$rowlen <= 0)
   
$rowlen 4// default columns

$ranklist explode('<br />'$this->post[rank]);
$this->post[rank] = '';
$col 0;
foreach(
$ranklist as $r)
{
   if (
$col >= $rowlen)
   {
      if (
$this->post[rank] != '')
         
$this->post[rank] .= '<br />';
      
$col 0;
   }
   
$this->post[rank] .= $r;
   
$col++;
}

$this->post[rank] .= "<!-- field50 ='" $this->registry->userinfo['field50'] . "' -->\r\n";
unset(
$col$rowlen$ranklist);
} else {
$rowlen $this->registry->userinfo['field50']; 
if (
$rowlen <= 0)
   
$rowlen 5// default columns

$ranklist explode('<br />'$this->post[rank]);
$this->post[rank] = '';
$col 0;
foreach(
$ranklist as $r)
{
   if (
$col >= $rowlen)
   {
      if (
$this->post[rank] != '')
         
$this->post[rank] .= '<br />';
      
$col 0;
   }
   
$this->post[rank] .= $r;
   
$col++;
}

$this->post[rank] .= "<!-- field50 ='" $this->registry->userinfo['field50'] . "' -->\r\n";
unset(
$col$rowlen$ranklist);

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:21 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.04481 seconds
  • Memory Usage 2,311KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (5)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete