Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #11  
Old 04-01-2008, 09:29 PM
skhms's Avatar
skhms skhms is offline
 
Join Date: Oct 2006
Location: Sweden
Posts: 120
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, I am not 100% sure if this is what you're looking for... it may not be the best solution either.

Unfortunately I don't think the custom profile fields is available in the calendar_showeventsbit template, which is the template I think you are looking for.

Therefor you need a plugin to get that information, a call to the function fetch_userinfo would work.
This will add one sql query for each user though. Which doesn't feel like the best solution honestly. Maybe someone else has a better idea.

I have attached a simple plugin to this message, its for the hook calendar_getday_event.

Import that plugin and edit the template calendar_showeventsbit

Find
Code:
<td align="$stylevar[left]"><if condition="$show['postedby']"><a class="bigusername" href="member.php?$session[sessionurl]u=$eventinfo[userid]">$eventinfo[musername]</a><else />&nbsp;</if></td>
Replace it with
Code:
<td align="$stylevar[left]"><if condition="$show['postedby']"><a class="bigusername" href="member.php?$session[sessionurl]u=$eventinfo[userid]">$eventinfo[musername]</a><div class="smallfont">$eventbituser[fieldx] $eventbituser[fieldx]</div><else />&nbsp;</if></td>
Change the fieldx as before of course.

Hopefully it was something like this you where looking for

/SK
Attached Files
File Type: zip calender_getuserinfo.zip (366 Bytes, 2 views)
Reply With Quote
  #12  
Old 04-02-2008, 02:17 PM
jpapadpapa jpapadpapa is offline
 
Join Date: Feb 2008
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks so much! I am a newbie who is jumping in with both feet, so I have to say I am not totally sure if I did this right. It didn't seem to change anything. I imported the plugin and then I edited the calendar_showeventsbit template, as you said. But, nothing seems to have changed. Did I miss a step?

Thanks again for helping! Seeing real names on all posts is a very important issue to the leaders of my group. Hope I can get this figured out!
Reply With Quote
  #13  
Old 04-02-2008, 03:40 PM
skhms's Avatar
skhms skhms is offline
 
Join Date: Oct 2006
Location: Sweden
Posts: 120
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That should have done it, I tested this and it works for me.

You can test and add some random text before $eventbituser[fieldx]
If that text shows up then it is the correct template and probably something wrong with the plugin.

/SK
Reply With Quote
  #14  
Old 04-02-2008, 06:00 PM
jpapadpapa jpapadpapa is offline
 
Join Date: Feb 2008
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tested it and apparently I do have the right template, but those fields are still not showing up. I also did some checking to make sure I did everything right with the plug-in (since I'm new at this) and it looks like all you do is upload it, correct? Everything looks right to my untrained eye. Any thoughts?

By the way, do you think this will slow things down? Is that what you were concerned about with it querying the database for all the users? (Again, I'm still learning). I am having a major issue with my site being slow right now, so I am scared of anything slowing it down further. But, I guess I could always take it out if it caused problems.

Thanks again for your help!
Reply With Quote
  #15  
Old 04-02-2008, 07:19 PM
skhms's Avatar
skhms skhms is offline
 
Join Date: Oct 2006
Location: Sweden
Posts: 120
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The plugin should be imported via the admincp (Plugins & Products -> Download / Upload Plugins -> Import Plugin Definitions XML File)
Make sure its activated. It should be by default though.

Not sure otherwise, not much that can goes wrong...
You did remember to change the X to correct fieldnumber I hope.

As I mention before this will add a query for each user when showing a calender event so it won't make things quicker...
But as you said, if there would be a problem just deactivate the plugin in the plugin manager.

/SK
Reply With Quote
  #16  
Old 04-02-2008, 10:23 PM
jpapadpapa jpapadpapa is offline
 
Join Date: Feb 2008
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmmmm...I cannot seem to figure out what in the world I am not doing right! Could it be a version thing? I'm running 3.6.8 PL2. Here is the code I pasted in (with a snippet of some of the code before and after). I don't know that it will really help for you to see it, because I pasted it in right where you said to, to my knowledge. But, maybe you'll catch something I missed.

PHP Code:
<tr>
    <
td class="thead" style="font-weight:normal"><strong>$vbphrase[calendar]</strong>: $calendarinfo[title]</td>
</
tr>
<
tr>
    <
td class="alt1">
        <if 
condition="$show['postedby'] OR $show['subscribed']">
        <
table cellpadding="0" cellspacing="0" border="0" width="100%">
        <
tr valign="bottom">
            <
td align="$stylevar[left]"><if condition="$show['postedby']"><class="bigusername" href="member.php?$session[sessionurl]u=$eventinfo[userid]">$eventinfo[musername]</a><div class="smallfont">$eventbituser[field19$eventbituser[field20]</div><else />&nbsp;</if></td
Reply With Quote
  #17  
Old 04-03-2008, 04:54 AM
skhms's Avatar
skhms skhms is offline
 
Join Date: Oct 2006
Location: Sweden
Posts: 120
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That seems correct to me.

I guess the plugin doesn't run correctly.
Do you have other plugins? Do they run?
I realize that this a bit desperate, but just to be sure that the plugin/hook system isn't turned off.

Otherwise go to the plugin and edit it. Add this after the current line.
PHP Code:
$eventbituser[field19] = 'field19';
$eventbituser[field20] = 'field20'
You should get "field19 field20" below the username

/SK
Reply With Quote
  #18  
Old 04-03-2008, 10:12 AM
jpapadpapa jpapadpapa is offline
 
Join Date: Feb 2008
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You know what...

After all this, my husband and I were trouble-shooting the site last night about the slowness issue and we found that the other code I had added to display the real names below the posts was slowing things down quite a bit! I think the host is not exactly lightning fast, but I'm kind of stuck with them right now.

Sooooo....I think I'm going to save all this for later. Maybe we can switch hosts at some point. I'm hoping the leaders of my organization don't notice that there are no longer names under the posts. This was quite important to them. But, for now, it's just not going to work, since pages were sometimes taking up to 35 seconds to load!

THANK-YOU for all your help, though! It is so nice when people take the time to help newbies like me.
Reply With Quote
Reply

Thread Tools
Display Modes

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 08:22 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06451 seconds
  • Memory Usage 2,268KB
  • Queries Executed 14 (?)
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
  • (2)bbcode_code
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (1)postbit_attachment
  • (8)postbit_onlinestatus
  • (8)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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete