Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
PhotoPost Random Image Option Details »»
PhotoPost Random Image Option
Version: , by SVTBlackLight01 SVTBlackLight01 is offline
Developer Last Online: Oct 2009 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 08-18-2003 Last Update: Never Installs: 0
 
No support by the author.

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.

Show Your Support

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

Comments
  #12  
Old 09-01-2003, 10:18 AM
SVTBlackLight01's Avatar
SVTBlackLight01 SVTBlackLight01 is offline
 
Join Date: Jan 2003
Location: Texas
Posts: 504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK. Will do so shortly.
Reply With Quote
  #13  
Old 09-01-2003, 12:29 PM
lasto lasto is offline
 
Join Date: Jan 2002
Posts: 1,514
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works brilliant m8
i just logged in at your forum and i seen the pics so wetn to usercp turned em off and bingo they gone.

Well done m8
Reply With Quote
  #14  
Old 09-01-2003, 01:13 PM
SVTBlackLight01's Avatar
SVTBlackLight01 SVTBlackLight01 is offline
 
Join Date: Jan 2003
Location: Texas
Posts: 504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks!
Reply With Quote
  #15  
Old 09-01-2003, 03:40 PM
lasto lasto is offline
 
Join Date: Jan 2002
Posts: 1,514
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lo m8,feedback as promised and thanks for letting me be a tester on this hack.Install time for me was about 15 mins max on vb2.3.

Installation went smooth - had no errors what so ever and it works

wot can i say it works - the box appears and there is 4 images in it (only downside is it says no image available but this could be to the fact photopost is not inside the vbull dir,but i have called it in and it shows the name and views etc so just need to solve this one.)

Anyway went to usercp and switched it off and bingo it was gone.
Hacks works sweet m8 - is one small thing though is there a query where i can set it so they are all off by default as i prefer it this way.

Top hack so congrats on your next release

Edit - pic attached as u can see the names are there just not pic an di cant run photopost in the same dir as vbull as some files have same name etc.

Adds 1 querie to main page
Attached Files
File Type: (21.3 KB, 19 views)
Reply With Quote
  #16  
Old 09-01-2003, 09:46 PM
SVTBlackLight01's Avatar
SVTBlackLight01 SVTBlackLight01 is offline
 
Join Date: Jan 2003
Location: Texas
Posts: 504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad you like it.

You can set it to be off by default by running this query:

ALTER TABLE `user` CHANGE `showphoto` `showphoto` SMALLINT( 6 ) DEFAULT '0' NOT NULL

As far as the problem with getting the "thumbnail not available", I'll take a look at it.
Reply With Quote
  #17  
Old 09-01-2003, 10:31 PM
Mickie D Mickie D is offline
 
Join Date: Jun 2002
Posts: 430
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how do you call your photos from your gallery to your board ???

are u using the thumbincluder.php or you use another method ???

i am currently writing addon hacks for pixelfx's photopost intergration (i just wrote a addon for forum home aswell )

i have got quite tied into this lol... and i am looking for a better way to call it than implode
Reply With Quote
  #18  
Old 09-01-2003, 10:48 PM
SVTBlackLight01's Avatar
SVTBlackLight01 SVTBlackLight01 is offline
 
Join Date: Jan 2003
Location: Texas
Posts: 504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes. This is using the thumbnail includer.

Actually the code to call the thumbs is taken form the PhotoPost site.

Here is what I used in index.php:

Code:
// Thumbnail includer hack
ob_start(); 
require("yourfile.php");
$thumbnails = ob_get_contents(); 
ob_end_clean();
// Thumbnail includer hack end
Then you can basically call the $thumbnails anywhere you want the thumbs to be displayed.

I'm finalizing the full instructions for the rest of it as well and will posting them soon.
Reply With Quote
  #19  
Old 09-01-2003, 11:01 PM
themonarch's Avatar
themonarch themonarch is offline
 
Join Date: Jun 2002
Location: Orlando, FL
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've been working on calling a specific user's photos and placing them in their profile. I'm getting close but it's not working yet. This is my first attempt at such a large modification. Here's what I'm doing so far.

Here's my php page code to get the user's photopost image, which when I load it in a browser window works:
Code:
<?php
//Connection statement
require_once('Connections/picConn.php');

// begin Recordset
$query_Recordset1 = "SELECT * FROM photos WHERE photos.userid = ('$userid')";
$Recordset1 = $picConn->SelectLimit($query_Recordset1) or die($picConn->ErrorMsg());
$totalRows_Recordset1 = $Recordset1->RecordCount();
// end Recordset
?>
<img src="mediapost/data/500/<?php echo $Recordset1->Fields('bigimage'); ?>" width="120" height="120">
<?php
$Recordset1->Close();
?>
Here's my connection script:
Code:
<?php 
	# Type="ADODB"
	# HTTP="true"
	# DBTYPE="mysql"
	
	$MM_picConn_HOSTNAME = "localhost";
	$MM_picConn_DATABASE = "mysql:photopost";
	$MM_picConn_DBTYPE   = preg_replace("/:.*$/", "", $MM_picConn_DATABASE);
	$MM_picConn_DATABASE = preg_replace("/^.*?:/", "", $MM_picConn_DATABASE);
	$MM_picConn_USERNAME = "username";
	$MM_picConn_PASSWORD = "password";
	$MM_picConn_LOCALE = "Us";
	$MM_picConn_MSGLOCALE = "En";
	$MM_picConn_CTYPE = "P";
	$KT_locale = $MM_picConn_MSGLOCALE;
	$KT_dlocale = $MM_picConn_LOCALE;
	$KT_serverFormat = "%Y-%m-%d %H:%M:%S";
	$QUB_Caching = "false";
	
	switch (strtoupper ($MM_picConn_LOCALE)) {
		case 'EN':
				$KT_localFormat = "%d-%m-%Y %H:%M:%S";
		break;
		case 'EUS':
				$KT_localFormat = "%m-%d-%Y %H:%M:%S";
		break;
		case 'FR':
				$KT_localFormat = "%d-%m-%Y %H:%M:%S";
		break;
		case 'RO':
				$KT_localFormat = "%d-%m-%Y %H:%M:%S";
		break;
		case 'IT':
				$KT_localFormat = "%d-%m-%Y %H:%M:%S";
		break;
		case 'GE':
				$KT_localFormat = "%d-%m-%Y %H:%M:%S";
		break;
		case 'US':
				$KT_localFormat = "%Y-%m-%d %H:%M:%S";
		break;
		default :
				$KT_localFormat = "none";			
	}


	
	if (!defined('CONN_DIR')) define('CONN_DIR',dirname(__FILE__));
	require_once(CONN_DIR."/../adodb/adodb.inc.php");
	ADOLoadCode($MM_picConn_DBTYPE);
	$picConn=&ADONewConnection($MM_picConn_DBTYPE);

	if($MM_picConn_DBTYPE == "access" || $MM_picConn_DBTYPE == "odbc"){
		if($MM_picConn_CTYPE == "P"){
			$picConn->PConnect($MM_picConn_DATABASE, $MM_picConn_USERNAME,$MM_picConn_PASSWORD, 
			$MM_picConn_LOCALE);
		} else $picConn->Connect($MM_picConn_DATABASE, $MM_picConn_USERNAME,$MM_picConn_PASSWORD, 
			$MM_picConn_LOCALE);
	} else if (($MM_picConn_DBTYPE == "ibase") or ($MM_picConn_DBTYPE == "firebird")) {
		if($MM_picConn_CTYPE == "P"){
			$picConn->PConnect($MM_picConn_HOSTNAME.":".$MM_picConn_DATABASE,$MM_picConn_USERNAME,$MM_picConn_PASSWORD);
		} else $picConn->Connect($MM_picConn_HOSTNAME.":".$MM_picConn_DATABASE,$MM_picConn_USERNAME,$MM_picConn_PASSWORD);
	}else {
		if($MM_picConn_CTYPE == "P"){
			$picConn->PConnect($MM_picConn_HOSTNAME,$MM_picConn_USERNAME,$MM_picConn_PASSWORD,
   			$MM_picConn_DATABASE,$MM_picConn_LOCALE);
		} else $picConn->Connect($MM_picConn_HOSTNAME,$MM_picConn_USERNAME,$MM_picConn_PASSWORD,
   			$MM_picConn_DATABASE,$MM_picConn_LOCALE);
   }

	if (!function_exists("updateMagicQuotes")) {
		function updateMagicQuotes($HTTP_VARS){
			if (is_array($HTTP_VARS)) {
				foreach ($HTTP_VARS as $name=>$value) {
					if (!is_array($value)) {
						$HTTP_VARS[$name] = addslashes($value);
					} else {
						foreach ($value as $name1=>$value1) {
							if (!is_array($value1)) {
								$HTTP_VARS[$name1][$value1] = addslashes($value1);
							}
						}
						
					}
					global $$name;
					$$name = &$HTTP_VARS[$name];
				}
			}
			return $HTTP_VARS;
		}
		
		if (!get_magic_quotes_gpc()) {
			$HTTP_GET_VARS = updateMagicQuotes($HTTP_GET_VARS);
			$HTTP_POST_VARS = updateMagicQuotes($HTTP_POST_VARS);
			$HTTP_COOKIE_VARS = updateMagicQuotes($HTTP_COOKIE_VARS);
		}
	}
	if (!isset($HTTP_SERVER_VARS['REQUEST_URI'])) {
		$HTTP_SERVER_VARS['REQUEST_URI'] = $HTTP_SERVER_VARS['PHP_SELF'];
	}
?>
And when I load the page in the browser using this format to switch users, it works...just switch the number of the user on the end.
http://www.allartistaccess.com/profi....php?userid=43

How would I get this to be over in the template getinfo?
Reply With Quote
  #20  
Old 09-01-2003, 11:19 PM
SVTBlackLight01's Avatar
SVTBlackLight01 SVTBlackLight01 is offline
 
Join Date: Jan 2003
Location: Texas
Posts: 504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could try the same method as above to set the variable and then call the variable in the profile template.

You would have to add the code to member.php.
Reply With Quote
  #21  
Old 09-02-2003, 01:16 AM
lasto lasto is offline
 
Join Date: Jan 2002
Posts: 1,514
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

lo SVTBlackLight01,cheers for pm all works ok now :0
Reply With Quote
Reply


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 06:26 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.04789 seconds
  • Memory Usage 2,333KB
  • Queries Executed 26 (?)
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
  • (3)bbcode_code
  • (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
  • (3)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
  • (1)postbit_attachment
  • (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
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete