vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   PhotoPost Random Image Option (https://vborg.vbsupport.ru/showthread.php?t=56289)

SVTBlackLight01 08-18-2003 12:32 AM

PhotoPost Random Image Option
 
I have made an add-on that will display random images from PhotoPost on the forums home page, seen here: http://www.modernengineuity.com/forums/index.php

What I want to do is make this an option in the user CP. I have already added the option to the user control panel and made a separate forumhome template.

What I need help with is modifying index.php to display this template depending on whether or not the user has chosen this option.

Thanks.

Dean C 08-18-2003 10:40 AM

Add a field fo the user table. Then make your radio buttons in the modifyoptions template. And use your name attributes value to update the field to 1 for yes and 0 to no :)

- miSt

SVTBlackLight01 08-18-2003 11:12 AM

Thanks for the reply Mist. That's exactly what I have done. I wasn't completely sure of that so it's good to know.

What I need to do now, and what is giving me problems, is use this to display or not display the random image template on the forums home.

Does that make sense?

Dean C 08-18-2003 01:04 PM

PHP Code:

if($bbuserinfo['userfield']==1// i.e. it's set to yes
{
    
// your stuff that happens when its set to yes goes here



SVTBlackLight01 08-18-2003 01:42 PM

Well, tried a few things, but it didn't work.

Here is what I'm using to display the thumbnails now

PHP Code:

 // Thumbnail includer hack
    
ob_start();
    require(
"../test.php");
    
$thumbnails ob_get_contents();
    
ob_end_clean();
 
// Thumbnail includer hack end 


So is this right to make it optional?

PHP Code:

if($bbuserinfo['showphoto']==1// i.e. it's set to yes
{
    
// Thumbnail includer hack
    
ob_start();
    require(
"../test.php");
    
$thumbnails ob_get_contents();
    
ob_end_clean();
    
// Thumbnail includer hack end


And where should it go?

Sorry for all the questions.

Dean C 08-18-2003 04:03 PM

No idea where you want to put it but that's how the code should be :)

- miSt

SVTBlackLight01 08-18-2003 08:57 PM

Thanks for all the help so far. I figured out how to make it work that way. The only problem is that I had the table for the thumbnails hardcoded in the forumhomes template. So when the option was set to no it just left an empty table.

I made a completely separate template for this, but I haven't had any luck calling the template. I'm thinking you have to set the variable for the template in index.php and then add the variable to the forumshome template where I want it to show up, right?

Any idea how to do this?

SVTBlackLight01 08-20-2003 06:26 PM

Anybody have any suggestions? :confused:

SVTBlackLight01 08-23-2003 12:28 PM

After taking a break from it, I got it working. I guess I had just been at it for too long before, because I figured it out pretty quickly this time around. If anyone is interested in using it, PM me.

TECK 09-01-2003 08:53 AM

You should simply post it...


All times are GMT. The time now is 09:46 AM.

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.01049 seconds
  • Memory Usage 1,738KB
  • 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
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete