![]() |
Help with side blocks pease
Hello everyone - I wonder if someone could give some pointers please. I recently bought a forum that was already established, so I am pretty naive about the nuts and bolts behind the scene
The version is 4.2.3 There is currently a section that renders a selection of 4 random photos drawn from a gallery elsewhere. I would like to move it to a side block so I can use that space for something else. I stupidly thought I could copy and paste the template code into a side block and that would be that, having removed the title bar, but all that happens is that the side block renders some of the code, irrespective of whether I paste it as html or php The template code that currently does the job is below. <vb:if condition="!empty($pppro_imagebits)"> <div id="pppro"></div> <ol class="floatcontainer"> <li class="forumbit_nopost"> <div class="forumhead foruminfo L1 collapse"> <a class="collapse" id="collapse_featurepal" href="forum.php#top"><img src="images/buttons/collapse_40b.png" alt="" /></a> <h2><span class="forumtitle"> From the Gallery</span></h2> </div> <ol class="childforum"> <li class="forumbit_post"> <div id="featurepal" class="forumrow table"> <table class="tborder" cellpadding="0" cellspacing="0" border="0" width="100%" align="center"> <tr> <td> <br /> <table cellpadding="$stylevar[cellpadding]" cellspacing="1" border="0" width="100%"> <tr> {vb:raw pppro_imagebits} </tr> </table> <br /> </td> </tr> </table> </div> </li> </ol> </li> </ol> <br /> </vb:if> Anyone kind enough to reply should assume I am an idiot with no knowledge. I am more than happy to be talked down to Best wishes |
What hook are you using to add the needed php code and what is the code you are adding there?
|
Thanks for your reply Lynne
I know nothing about hooks I'm afraid:confused: I simply pasted the code above into the block, then tried experimenting with it when I found it didn't work. |
Typically in a forum block, you need to return data, just as if you are operating inside a PHP function with local variables. You would need to build your data, then render your HTML containing the data you built, and return the finished HTML.
For example, here is the PHP code I use for a simple forum block that displays the users who have visited the site within the last 7 days: PHP Code:
|
Simple is a relative term Mark :)
However, I have found that using a table with a sidebar block does not output with the desired effect. My knowledge of writing PHP is limited as well. I would take some time and research past threads, someone might have already built out something that you are looking for (you might need to modify a bit) |
I have a forum side block that will pull a single image from any gallery you want ....
Replace the id which is highlighted in red with the id of the album which you want to use ... You can also change the width of the sideblock as well, the width for this one is highlighted in red and its 225 px ... Code:
// -- Widget Configuration -- |
Thanks for your replies guys.
The current setup renders four random thumbs drawn from multiple albums in Photopost Pro, so although I see where you're coming from CAG, it doesn't really work because there are many album lists not just one. The code below works perfectly in the main body of the home page, and all I'm trying to do is make it work in a sideblock instead. Mark, the data is built and works just fine where it is, I just have no understanding of hooks and returns and so on to make it work in a block. I know I am probably being particularly dim, but when you don't know, you just don't know. Code:
<vb:if condition="!empty($pppro_imagebits)"> |
Ok try this ...
Make a new template and call it some like "block_html_random_photos" Inside the template add this Code:
<vb:if condition="is_member_of($bbuserinfo, 9)"> Make it an html block then inside the content block add this Code:
<div align="center"><!--{vb:raw pppro_imagebits}--></div> Code:
<div align="center">{vb:raw pppro_imagebits}</div> One of these should work .... Let me know if it works for yah' |
Thanks for your reply. Unfortuantely neither works. They both render nothing at all, but I'm really grateful to you for trying.
|
Are you putting this side block on the same page that the current random images are on? If you go to admincp > Products & Hooks > Manage Products, do you see anything titled that may be the modification being used here? If so, then go to admincp > Products & Hooks > Hook Manager and look up the plugins for that Product - can you give us the titles and then hook location for them? And, are you creating a Forum Block or are you trying to create a CMS Block?
|
As of yet, I'm still using Photopost, too. I can't really remember the installation process, but from what I can see one had to manually create a plugin at forumhome_complete, doing nothing but including the gallery's inc_features.php file.
In my case the single line is PHP Code:
|
1 Attachment(s)
Hi Lynne - thanks for your reply.
The block I'm trying to create is to go in an existing column of blocks on my home page. The controls for that column already exist within Forums & Moderators>Forum Blocks Manager, and I know the column works because there are already one or two blocks in it, both of which I have edited myself without issue. The side block is on the home page, which is indeed the same page as the existing random images appear, but only because I was hoping to have the side block working before I switch off the existing images. I can do that now though if you think it may be causing a conflict My version of vB is 4.2.3 - my control panel has a section labelled Plugins & Products. Looking in there I can see Manage Products, and Plugin Manager. Manage Products shows me no useful information at all, beyond that it is PhotoPost Pro v8.2 Plugin Manager shows me various different options to explore and I've pasted a screenshot of those options below. There is no menu option Hooks Manager, but each of the options in the screenshot shows a hook. I can't identify which would be relevant though, and I'm not entirely certain that any of them are, but that may just be further proof of my total ignorance of the subject. |
I'm not Lynne, but maybe you're reading my posts anyway ;)
As I said: It's at the hook forumhome_complete, so it's obviously "Photopost Featured Photos on Forumhome". Open it, and you'll find the code I posted above. |
Hi Cellarius - sorry, I don't know how I missed your post.
Yes, Photopost Featured Photos on Forumhome - Doh!!! I did warn you I am dim. However , no code resembling yours within it I'm afraid. Code:
require $vbulletin->options['pppath'].'/config-int.php'; |
OK, so that's practically the code that's in the included file, in my case. As I said, I'm on vB3 still, but it's basically the same.
You'd just need to find out which hook to use and probably adapt the template. Since I don't have a vB4 installation handy anymore, someone else will hopefully chime in here. |
Is the hook not 'forumhome_above_forums' ?
|
All times are GMT. The time now is 05:00 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|