vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   How do I put the tag cloud on a custom page? (https://vborg.vbsupport.ru/showthread.php?t=259133)

cbiweb 02-19-2011 05:43 PM

How do I put the tag cloud on a custom page?
 
I've created a vBulletin powered page for the purpose of building a totally customized homepage for a client. He would like the tag cloud to be on that page. I've tried copying all the code from another page that shows the tag cloud, even tried copying an entire template onto the custom page, and got everything but the tag cloud itself. I also tried doing the registering variables thing but I don't totally understand that either, so it's most likely I've got that wrong too. Can anyone help me out on this? Thanks in advance.

Lynne 02-19-2011 07:17 PM

I just took the code from my product - Tag Cloud on Forumdisplay and added it into the page. You have stuff in the products that adds to the $phrasegroup and $globaltemplates. Then add all the code from the forumdisplay_start plugin except get rid of the whole condition around it. Then, make sure to set $foruminfo[forumid] to 0 because or else you will get an error and then get rid of anything that has to do with the $forumid - in the query and when setting the tagtest_urls (two places). Then, in your php page, make sure to register $cloud_html for your template ($templater->register('cloud_html', $cloud_html); ) and enter the variable into the template ({vb:raw cloud_html}). That should work.

cbiweb 02-19-2011 11:53 PM

Thanks, Lynne. And sorry if I seem a bit stunned, but...
Quote:

Originally Posted by Lynne (Post 2164377)
I just took the code from my product - Tag Cloud on Forumdisplay...

Your product has 6 or 7 files of code. Which code did you take? All of it from all the files? Or are you talking about the optional snippets of code shown in your product thread that you linked to?

Quote:

Originally Posted by Lynne (Post 2164377)
...and added it into the page.

The HTML page? PHP page?

Quote:

Originally Posted by Lynne (Post 2164377)
You have stuff in the products that adds to the $phrasegroup and $globaltemplates.

It's good to have stuff. Now what to do with it? ;) :)

Quote:

Originally Posted by Lynne (Post 2164377)
Then add all the code from the forumdisplay_start plugin...

Add it into what? Where?

Lynne 02-20-2011 03:03 AM

I just went through each plugin and grabbed what was needed and put it into the custom page. For instance...
hook location - parse_templates
- This plugin adds the css to the page. Instead, I went to the taglist.css template and just copy/pasted the css into my template in the <head> area with the required <style> tags around it.

hook location - cache_templates
- This plugin caches the templates, so I just added the template names to the $globaltemplates array in the custom page.

hook location - forumdisplay_start
- This plugin has all the needed code. I grabbed it all, removed the condition around it, and removed anything having to do with $forumid in there (three places, as I said) and added at the top the thing about forumid equaling 0.

hook location - init startup
- This plugin adds the phrasegroup, so I added it to the $phrasegroup array.

hook location - tags_list_query_limit
- This hook location is done. I did nothing with the content in this plugin.

So, I basically just went through every plugin and put the contents into the proper place in the custom page.

cbiweb 02-21-2011 10:14 PM

Thanks again, Lynne. I understand now. It may be a couple days before I get to do it, but I'll post back if I have any problems.

cbiweb 03-01-2011 01:43 AM

Thanks to your help I was able to get the cloud on the custom page; however, clicking a tag takes me to a 404 page. :confused: Feel free to PM or email me if you'd rather take it off thread.

Lynne 03-01-2011 01:48 AM

Have you looked at the URL and can you see what is wrong with it? Can you post a link to the page?

cbiweb 03-01-2011 01:56 AM

Actually, right after posting I did some digging and fixed it in the tag_cloud_link template where the URL is relative (and rightly so). I made it absolute. Not the most elegant fix, but one that will get it done.

The cloud is disabled on the new page for now, until I can style a container for it tomorrow.

Lynne 03-01-2011 04:25 PM

Glad you got it figured out. :)

cbiweb 03-04-2011 06:41 PM

ugh... I'm just not getting this. The cloud is there, but two elements of it I don't want: the collapse button and the heading "Tag Cloud". I know it's all put together from various templates, and I've tried using the relevant snippets and pasting them into my custom template, but it's not working. Very frustrating. Here's the page with the cloud, and you can see the result. View in Chrome to see the missing image icon, since it doesn't show up in Firefox. My time is so limited for troubleshooting, it's taking me days to get this done. :(:(:(

Lynne 03-04-2011 10:12 PM

You don't want it collapsible and you don't want the title, Tag Cloud, to show? So, you only want the tags themselves? If so, then remove this from the template:
HTML Code:

    <div class="collapse">
        <a class="collapse" id="collapse_forum_tags" href="{vb:raw relpath}#top"><img src="{vb:stylevar imgdir_button}/collapse{vb:raw vbcollapse.collapseimg_info_options}_40b.png" alt="" /></a>

        <h4 class="forumoptiontitle blockhead"><span class="optiontitle">{vb:rawphrase tag_cloud}</span></h4>
    </div>


cbiweb 03-07-2011 01:21 PM

That would remove it from everywhere, including the forums. I just want it removed from the new custom page. I'll explain a little more what's happening...

In the template for the custom page, the cloud is powered by this:
Code:

{vb:raw cloud_html}
That pulls in the cloud, which apparently uses multiple templates and code from the forum templates & files, which includes the collapse button and title. When I tried grabbing what I believe is the relevant code I actually want from these other sources, and paste them directly into my custom template, the cloud doesn't work at all. The code you posted above is one of the snippets I pasted into the custom template, but no go.

There must be a much easier way to figure this out, but vB4's new way of handling things has stymied me. I feel like a n00b all over again, LOL.

Lynne 03-07-2011 05:27 PM

Then put a condition around that code that removes it for your custom page. Did you define THIS_SCRIPT on your page? If so:
HTML Code:

<vb:if condition="THIS_SCRIPT != 'your_page'">
    <div class="collapse">
        <a class="collapse" id="collapse_forum_tags" href="{vb:raw relpath}#top"><img src="{vb:stylevar imgdir_button}/collapse{vb:raw vbcollapse.collapseimg_info_options}_40b.png" alt="" /></a>

        <h4 class="forumoptiontitle blockhead"><span class="optiontitle">{vb:rawphrase tag_cloud}</span></h4>
    </div>
</vb:if>

Or create a custom template to use instead of that one and reference it in your code.

cbiweb 03-08-2011 12:35 PM

Okay, that does the trick. Not sure why that didn't come to me in a dream or something. But maybe that's it - I need more sleep! lol

ceho 07-15-2011 06:29 PM

Uhm would it be possible to get the example codes of a custom page template and the according php file? I have to admit I don't get very far with the above, sorry. Thanks a lot for some examples.


All times are GMT. The time now is 05:49 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.01092 seconds
  • Memory Usage 1,760KB
  • 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
  • (2)bbcode_html_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (15)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete