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&p=<if condition="$editorid!='vB_Editor_QR'">{$vbulletin->GPC[postid]}</if>&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!