Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons

Reply
 
Thread Tools
Menalto random gallery photo in vBa 2.1 Details »»
Menalto random gallery photo in vBa 2.1
Version: 1.00, by defcon_420 defcon_420 is offline
Developer Last Online: Jul 2007 Show Printable Version Email this Page

Version: 3.5.4 Rating:
Released: 04-29-2006 Last Update: Never Installs: 7
Uses Plugins Template Edits
Code Changes Additional Files Is in Beta Stage  
No support by the author.

This is my first mod, i am not a programmer but i'll try to give support IF i can.

This mod is to display a random photo from Menalto Gallery 2.1 in vBadvanced 2.1


READ ME
For this hack to work you must have both Menalto Gallery 2.1 and vBadvanced CMPS 2.1 installed
This installation assumes that your vBulletin install is in your webroot and your gallery install is in /gallery2/" If they are not you will have to change the path's yourself as only you know where you have installed them.


Installation

Step 1.
Open randomcmps.php replacing the CAPS with your domain information and path to main.php in your gallery directory, save and upload this file into your webroot.

Code:
<head><link rel="stylesheet" href="http://www.YOURDOMAIN.COM/GALLERY2/main.php?g2_controller=imageblock.ExternalCSS&amp;g2_frames=wood"/></head>
<?php 
@readfile('http://www.YOURDOMAIN.COM/GALLERY2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=fullSize&g2_show=title'); 
?>
Step 2.
Edit the plugin randomcmps-plugins.xml replace the CAPS with your domain information and save

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
 
<plugins>
    <plugin active="1" product="adv_cmps">
        <title>Random Gallery Photo in Portal</title>
        <hookname>global_start</hookname>
        <phpcode><![CDATA[ob_start();
   include('http://www.YOURDOMAIN.com/randomcmps.php');
   $includedrg = ob_get_contents();
ob_end_clean();]]></phpcode>
    </plugin>
</plugins>

Step 3

AdminCP> Plugin System> Download/Upload Plugins> Browse> find randomcmps-plugins.xml and import make sure the plugin is active after importing


Step 4

AdminCP> Styles and Templates > Style Manager > Add New Template >

TITLE:

Code:
adv_portal_newrandomgallery2


TEMPLATE

Code:
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<thead>
<tr>
<td class="tcat"><span class="smallfont"><strong>$vba_options[portal_blockbullet]Gallery</strong></span></td>
</tr>
</thead>
<tr>
<td class="$getbgrow" width="100%" align="center">
$includedrg
</td>
</tr>
</table>
<br />


PRESS SAVE AND RELOAD


Step 5

AdminCP > vBa CMPS> Add Module> Template>


Code:
Title:    gallery2
column:    YOUR CHOICE
display order: 0   but u can put it where u want it
Active: Yes
 
Template to include: newrandomgallery2
 
module shell template options: no
Set the usergroups u want to see it and save


Step 6

AdminCP> vBa CMPS> Edit Pages

check "gallery 2" in the Modules Enabled box for the pages you want the random photo to display in and save



KNOWN ISSUE ONLY EFFECTS EMBEDDED MODE:
If Gallery2.1 is running in embed mode and a user clicks the random photo in vBadvanced they user is directed to the non embedded gallery.

As i am not a programmer any improvements or help with this or other issues would be gratefully accepted

DISCLAIMER:
This hack maybe chop up, torn up, thrown out, spit on, ripped up or modified in any way you see fit as long as it dont involve me getting into trouble. USE AT YOUR OWN RISK

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 07-13-2006, 08:40 PM
oldgoat oldgoat is offline
 
Join Date: Mar 2006
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the settings to use in randomcmps.php are indicated in the image block settings of the gallery site admin page
Reply With Quote
  #13  
Old 07-21-2006, 06:47 PM
fringehead fringehead is offline
 
Join Date: Nov 2004
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by majorxp
Hey.

I totally could be missing something, but if you have the G2 image block module installed, wouldn't it be easier to just make a module that loads it instead?

That is what I did and it works great. It also will load either embedded or external (depending on the url).

I attached the module I made (it took all of 3 minutes) and should work with any version of vba with a small change here or there... Just edit the file to your domain and delete or add to have multiple images.

Cheers!
So this won't work for Vbulletin? Just Advanced? I use the image block on my forum but don't have the right url's for the embedded gallery. They open up non-embedded. Could you make one for vanilla VB?

Thanks,

Sean
Reply With Quote
  #14  
Old 08-08-2006, 05:25 AM
thablewprnt thablewprnt is offline
 
Join Date: Aug 2006
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is this available for 3.6?
Reply With Quote
  #15  
Old 01-03-2007, 03:27 AM
StuntFactoryX StuntFactoryX is offline
 
Join Date: May 2006
Posts: 228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works w/ 3.6.4
Reply With Quote
  #16  
Old 02-09-2007, 03:15 AM
sinner sinner is offline
 
Join Date: Jul 2003
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone got this working properly with the integrated Gallery/vBa yet? Here's the link to that hack:

https://vborg.vbsupport.ru/showthread.php?t=111931

I'd love to get this working properly but I have no idea how to do it myself. Thanks in advance to anyone who can help!
Reply With Quote
  #17  
Old 04-20-2008, 02:10 PM
essexbikers essexbikers is offline
 
Join Date: Apr 2007
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm having such a strange problem with this.
It was all working fine until I added a new style to the forum. It's a child style of the working one and the adv_portal_newrandomgallery2 is inherited. The preview works and I see a random image if i browse to the randomcmps.php file in a browser.

Im stumped. If i go back to the original style it works fine.

Anyone have any suggestions as to what could be causing it?

Cheers,
Dan.
Reply With Quote
  #18  
Old 05-11-2008, 04:39 PM
m_c m_c is offline
 
Join Date: Feb 2008
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Has anybody managed to get this to work in vBa 3?

The preview works, but as soon as I add the module to a page, the contents of the $includedrg don't show. Looking at the displayed page source, the $include isn't returning anything to the output html.
Reply With Quote
  #19  
Old 11-17-2008, 01:37 AM
skubaman skubaman is offline
 
Join Date: Dec 2006
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does it work with vba 3.*?

Thanks
Reply With Quote
  #20  
Old 06-21-2009, 05:43 AM
nmilne nmilne is offline
 
Join Date: Aug 2008
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Rather than use a plugin, another option is just to write a php file that you use as a php based module (as opposed to template based) and make a call to a template in the php code. You can also decide whether you want to have it link into a standalone gallery (as the examples given so far) or whether to link into an embedded gallery. You do this in the way you compose the request to get the latest/random/whatever image.

e.g.
http://{path to your gallery install}/main.php?g2_view=imageblock.External&g2_blocks=ran domImage&g2_show=fullSize&g2_show=title
gives a random image which will link to a stand alone gallery page

vs.
http://{path to your gallery integrated page}/gallery.php?g2_view=imageblock.External&g2_blocks= randomImage&g2_show=title
which gives a random image which links to an embedded gallery

Try both of the above just in a browser window and 'view source' to see the different links passed back by gallery in each case.

I'll give you an example here of what I did to put a latest image block in my web site.

Just create a new php file (called whatever you want) in your modules/ directory with the following content:
Code:
<?php
// ++=========================================================================++
// || Gallery block for vBAdvanced
// ++ ========================================================================++

// Get the latest image page block content from gallery
$gallery_content_url = $vbulletin->options['bburl'].'/gallery.php?g2_view=imageblock.External&g2_blocks=recentImage&g2_show=title';
$gallery_content = file_get_contents($gallery_content_url);

// Now call the template so that it can decide where to put the content
eval('$home["$mods[modid]"][\'content\'] = "' . fetch_template('adv_gallery_block') . '";');

?>
Then create a new module in VBA admin as a PHP module, choose the php file you created above in the 'file to include' drop down (make sure the file is in the modules directory), give it a unique id and add the name of a new template you need to create for the block (I called mine 'adv_gallery_block' but it can be whatever you want). Then add it to whatever VBA page definitions you have according to how you've set up your files and integration.

Finally, create a new template with the name you picked above (mine being called 'adv_gallery_block' in your desired style. You can design the template to garnish the image any way you want and reference the content that is extracted in the php file created previously. My simple example is -
Code:
<tr align="center">
	<td class="$bgclass">
		$gallery_content
	</td>
</tr>
Which simply dumps the content in the middle of a centred table data element. Make sure you've got he module enabled and the permissions are set correctly and you should be away and running

You can see mine in action at -

http://www.supermotoaus.com
Reply With Quote
  #21  
Old 06-21-2009, 08:50 PM
Ranger187 Ranger187 is offline
 
Join Date: Nov 2003
Posts: 921
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="https://vborg.vbsupport.ru/showthread.php?t=111931&page=20" target="_blank">https://vborg.vbsupport.ru/showt...111931&page=20</a>

This thread is super uber old.
Reply With Quote
Reply

Thread Tools

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 07:59 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.06063 seconds
  • Memory Usage 2,311KB
  • Queries Executed 25 (?)
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
  • (7)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete