View Full Version : Dynamics count in user profile and postbit
aproape
09-25-2008, 10:58 PM
Good morning everyone!
OK - the profile tab and postbit info addon for dyna articles is here! :-)
Please find the attached file for all the necessary plugins/templates.
There are two new templates to be added and one existing to be modified [postbit or postbit_legacy, depending on what you use].
Instructions:
Profile tabs
1. Add the content of the file memberinfo_block_storybit.html to a template with the name memberinfo_block_storybit
2. Add the content of the file memberinfo_block_stories.html to a template with the name memberinfo_block_stories
3. Copy the file memberinfo_block_stories.php to [forums_path]/plugins/
4. Add the plugin vbulletin-plugin-memberinfo-stories.xml to vbulletin
Postbit info
0. Copy the showthread_profile_stories.php in [forums_path]/plugins/
1. Add the plugin vbulletin-showthread_profile_stories.xml from the folder
2. Modify the template (postbit or postbit_legacy found in admin cp => Styles => Postbit Templates) to add the following:
<if condition="$post['nrstories']">
Stories: $post[nrstories]
</if>
where you want it to appear in postbit [after Location.. or.. Posts.. your choice].
You can also change the word [Stories] above with anything else you prefer [Articles, Reviews, etc.]
Note: the prefix of the VB ADvanced tables should be 'adv_dyna'. Other settings will be read automatically from the already existing context/installation.
Let me know if you have any questions.
For the tab bit - you can specify a priority for the plugin so that it moves the tab in front of others you might have [vbexperience or awards etc].
I haven't tried this on a multiple-instance installation - it will probably require some minimal changes to the code [multiply the selects from the tables and add to the total, if needed].
Enjoy!
Cheers,
aproape
Janfri
09-26-2008, 05:18 AM
Thank you aproape, installed and works. The only "problem" I have is that I changed Stories for Questions but in the tab in the user profile still shows Stories. I changed the postbit as follows: <if condition="$post['nrstories']">
Questions: $post[nrstories]
</if>
Do I miss anything? Thanks for advanced!
I found out that "Stories" hs to be changed in memberinfo_block_stories.php, 'title'=> 'Put in what you want"
But I still observe another problem: The links are not corect for my installation, because Dynamics is not installed in the root directory but in a directory called "terms". On the profile page the link http://thetranslation.org/showentry.php?e=3 should be http://thetranslation.org/terms/showentry.php?e=3 Where can I change that, please?
aproape
09-26-2008, 07:36 AM
Hi there Janfri!
The postbit change you did will only affect the postbit information. *smile*
In order to change the tab name, go to the memberinfo_block_stories.php file [from the /plugins directory], edit it - and change the title from [Stories] to [Questions].
Hope this helps! Let me know.. :-)
Cheers,
aproape
aproape
09-26-2008, 07:38 AM
Hi there Janfri - just noticed your reply.
OK - question for you.. do you have the CMPS module for Dynamics installed?
[this one: http://www.vbadvanced.com/forum/showthread.php?t=27872]
Let me know - thanks!
Cheers,
aproape
Janfri
09-26-2008, 07:42 AM
Hi there Janfri!
The postbit change you did will only affect the postbit information. *smile*
In order to change the tab name, go to the memberinfo_block_stories.php file [from the /plugins directory], edit it - and change the title from [Stories] to [Questions].
Hope this helps! Let me know.. :-)
Cheers,
aproape
Hi aproape, thank you, yes, after changing the title, the tab name has changed. But what about the wrong links? How do I change the links to the dyna folder. I did not install dyna in the root directory, and, as described above, the links shown in the (now visble) Questions tab do not work...
Thanks again and best regards
Janfri
larina
09-26-2008, 08:40 AM
Thanks very much aproape, it works perfectly :)
Janfri, for the links go to the template memberinfo_block_storybit and add the folder in front of the links, like that:
<td><a href="/terms/$story[main_url]">$story[title]</a></td>
<td><a href="/terms/$categ[main_url]">$categ[title]</a></td>
Another note: People who use different instances of dynamics have to change:
In file memberinfo_block_stories.php find
$stories = $this->registry->db->query_read("SELECT * FROM " . TABLE_PREFIX . "adv_dyna_entries WHERE open > 0 AND userid=" . ((int)$userid));
and replace adv_dyna with the table-name you use.
In the same file find
$categ = $vbulletin->adv_dyna_cats[$story['catid']];
and replace adv_dyna with the table-name you use.
In the file showthread_profile_stories.php find
$stories_cnt = $db->query_read("SELECT COUNT(*) AS nrstories FROM " . TABLE_PREFIX . "adv_dyna_entries WHERE open > 0 AND userid=" . ((int)$post['userid']) . " GROUP BY userid");
and replace adv_dyna with the table-name you use.
larina
Janfri
09-26-2008, 09:13 AM
Janfri, for the links go to the template memberinfo_block_storybit and add the folder in front of the links, like that:
<td><a href="/terms/$story[main_url]">$story[title]</a></td>
<td><a href="/terms/$categ[main_url]">$categ[title]</a></td>
Thank you very much larina, now it works perfectly. For the future, I would also appreciate the possibility to show the replies to a thread in the postbits and in a cmps module on the frontpage and make replies rateable. But this is off-topic here. Have a nice day everybody!
larina
09-26-2008, 10:25 AM
I just added an addition to it. If you want a link to all dynamics entries of the special user inside the postbit, add the following to your postbit or postbit_legacy template, depending on what you use:
find:
$vbphrase[find_more_posts_by_x]</phrase></a></td></tr>
below it put:
<if condition="$post['nrstories']"><tr><td class="vbmenu_option"><a href="/yourdynamicsfolder/members/$post[username]-$post[userid]/" rel="nofollow">Rezepte von $post[username] finden</a></td></tr></if>
Replace yourdynamicsfolder with the folder-name you use for dynamics.
And translate "Rezepte von ... finden" to your language.
You see it in the attachment (in my language it is called "Rezepte von mira finden").
This only works with SEO friendly URLs enabled inside dynamics.
larina
larina
09-26-2008, 11:59 AM
Just so you know ... if you want to place the dynamics-tab in the members-profile more to the left or more to the right, go to the template MEMBERINFO and find this:
<div id="profile_tabs">
$template_hook[profile_left_first]
$blocks[visitor_messaging]
$blocks[aboutme]
$blocks[stats]
$blocks[friends]
$blocks[infractions]
$blocks[contactinfo]
$template_hook[profile_left_last]
</div>
The dynamics-tab is using $template_hook[profile_left_last]
So place this up to put it more to the left, or just sort all tabs as you want them to appear.
larina
dubai2006
12-08-2008, 03:56 PM
Hi
i got this problem when showing user profile page:
Fatal error: Cannot redeclare construct_categories() (previously declared in /home/forum/includes/vba_dyna_functions.php:904) in /home/Forum/includes/functions_gallery.php on line 176
Why?
Whay to do?
Brian
12-09-2008, 12:40 PM
If you upgrade to the latest version of vBa Dynamics then you will not receive that error.
gv1.3
03-25-2009, 02:48 AM
Hi guys,
I have used this mod and it works really well. I have a question though.
I would like to add a second tab in the users profile to display info from a second instance of VBA dynamics. Is this possible? At the moment the tab that has been created displays info from my first instance of VBA dynamics but I cannot see any way to get another tab to display with info from a second instance.
Is this possible?
Thanks!
gv1.3
03-30-2009, 11:34 AM
just thought I would bump this incase someone has an answer to above?
Any advice greatly appreciated :)
Dylan
werwolf
04-16-2009, 06:38 PM
Need some help with that ;)
angeljs
01-17-2011, 10:32 AM
I just added an addition to it. If you want a link to all dynamics entries of the special user inside the postbit, add the following to your postbit or postbit_legacy template, depending on what you use:
find:
$vbphrase[find_more_posts_by_x]</phrase></a></td></tr>
below it put:
<if condition="$post['nrstories']"><tr><td class="vbmenu_option"><a href="/yourdynamicsfolder/members/$post[username]-$post[userid]/" rel="nofollow">Rezepte von $post[username] finden</a></td></tr></if>
Replace yourdynamicsfolder with the folder-name you use for dynamics.
And translate "Rezepte von ... finden" to your language.
You see it in the attachment (in my language it is called "Rezepte von mira finden").
This only works with SEO friendly URLs enabled inside dynamics.
larina
Hi, thank you for this. However, I can only get it to work if I remove the if statements, otherwise the text doesn't show up. :(
angeljs
02-03-2011, 09:46 AM
Is there a way to show attachment thumbnails instead of the link to the file?
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.