View Single Post
  #252  
Old 03-15-2009, 01:47 AM
bjhuang bjhuang is offline
 
Join Date: Jul 2006
Posts: 77
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Warning: this is a little bit complex, do not try this if you are not a experienced vb coder. Do it on your own risk!

to get photo popup work with images uploaded as attachments:

1. edit option "Products" (photo_popup_products), add "attachment" to validation code

2. add "attachment" to option "Products" (photo_popup_products)

3. add new phrase to "Global" group: photo_popup_attachment as "Attachments"

4. upload includes/photo_popup_config_attachment.php

5. modify photo_popup.php

Code:
[FIND]
$url_get_string =

[ADD BELOW]
$poststarttime =& $vbulletin->input->clean_gpc('r', 'poststarttime',TYPE_UINT);
$postid =& $vbulletin->input->clean_gpc('r', 'postid',TYPE_UINT);
if($poststarttime) $posthash = md5($poststarttime . $vbulletin->userinfo['userid'] . $vbulletin->userinfo['salt']);
if($vbulletin->GPC['e'] == "vB_Editor_QR") $postid=0;
$url_get_string .= "&postid=$postid&poststarttime=$poststarttime";

[FIND]
if ($insert_options_count > 1)

[REPLACE]
if ($insert_options_count > 1&&$which_product != 'attachment')

[FIND]
<input name=\"e\" type=\"hidden\" value=\"$editor\" />

[ADD BELOW]
<input name=\"postid\" type=\"hidden\" value=\"$postid\" />
<input name=\"poststarttime\" type=\"hidden\" value=\"$poststarttime\" />

[FIND]
// Add whitespace to codebits

[ADD ABOVE]
	if($which_product == 'attachment') {
		$text = $vbphrase[attachment];
		$codebb = "[ATTACH]".$img['id']."[/ATTACH]";
		$codehtml = $codebb;
	}
6. modify all the three TMS plugins:
Code:
[FIND]
photo_popup.php?e=$editorid

[REPLACE]
photo_popup.php?e=$editorid&amp;p=<if condition="$editorid!='vB_Editor_QR'">{$vbulletin->GPC[postid]}</if>&amp;poststarttime=<if condition="$timenow=TIMENOW">$timenow</if>
7. (optional) modify TMS plugin "Add Photo Popup Link":
Code:
[FIND]
            </td>
</td>
        </tr>
[REPLACE]
				</tr><if condition="$can_attach"><tr><td>
				[<a href="#" onclick="document.getElementById('manage_attachments_button').click();return false;">$vbphrase[manage_attachments]</a>]
				</td>
        </tr></if>
8. now you will see the attachments belong to a post within photo popup window!
Attached Files
File Type: php photo_popup_config_attachment.php (2.6 KB, 14 views)
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01280 seconds
  • Memory Usage 1,788KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_attachment
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete