Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Coppermine VbCode and HTML output Details »»
Coppermine VbCode and HTML output
Version: 1.00, by DjTaz DjTaz is offline
Developer Last Online: Oct 2011 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 02-11-2006 Last Update: Never Installs: 3
Code Changes  
No support by the author.

For those of you who have integrated Coppermine Photo Gallery into your Vbulletin site , you will know it runs smoothly along side it and works great.

I had one issue though - people on my site wanted to be able to post some of the photos from their gallery on the forum boards, but they lacked a lot of the knowledge to be able to check the URL of the photo... this caused a problem.

Anyway , i added this little hack that simply displays the VBCode and HTML code for the any photo so it can be used on Vbulletin , or for that matter , any site.


In /gallery/lang/english.php

Find :
Code:
$lang_picinfo = array(
  'title' =>'File information', //cpg1.3.0
  'Filename' => 'Filename',
  'Album name' => 'Album name',

Add below :
Code:
  
  'BB Code' => 'VB Code',
  'HTML Code' => 'HTML Code',
__________________________________________________ _______________________

in /gallery/displayimage.php

Find :
Code:
   $info[$lang_picinfo['Filename']] = htmlspecialchars($CURRENT_PIC_DATA['filename']);
   $info[$lang_picinfo['Album name']] = '<span class="alblink">' . $owner_link . $ipinfo . '<a href="thumbnails.php?album=' . $CURRENT_PIC_DATA['aid'] . '">' . $CURRENT_ALBUM_DATA['title'] . ' Photos</a></span>';
add below
Code:
////////////////////////////////////////////////
//// OUTPUT CODES FOR VBCODE AND HTML CODE /////
//////////////// BY DjTaz  (www.djtaz.com)//////
////////////////////////////////////////////////
	$picture_url = get_pic_url($CURRENT_PIC_DATA, '');
	$website = $CONFIG["ecards_more_pic_target"];
	$info[$lang_picinfo['BB Code']] = "<font color=RED></FONT COLOR>";
	$info[$lang_picinfo['HTML Code']] = "<font color=green><XMP> <img src='".$website.$picture_url."'></XMP></font>";
////////////////////////////////////////////////
//// END OF VBCODE AND HTML OUTPUT CODE ////////
////////////////////////////////////////////////

Reupload both files , click and thats it , your done !

Supporters / CoAuthors

Show Your Support

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

Comments
  #2  
Old 02-12-2006, 02:35 PM
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Posts: 3,832
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Let me be your first installer here.

Thanks!
Reply With Quote
  #3  
Old 02-12-2006, 05:40 PM
Xzyte Xzyte is offline
 
Join Date: Nov 2005
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Was looking for this, thanks DjTaz.

I installed it on vB 3.5.3 with Coppermine 1.4.3 and if works fine.

One question: Is it possible to add some code and also get a link to the resized picture instead of the full sized one?
Reply With Quote
  #4  
Old 02-12-2006, 08:32 PM
The Chief's Avatar
The Chief The Chief is offline
 
Join Date: Aug 2005
Location: Montreal
Posts: 1,037
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this is great, I will be installing tonight

thanks!
Reply With Quote
  #5  
Old 02-14-2006, 10:56 AM
DjTaz DjTaz is offline
 
Join Date: Apr 2003
Posts: 251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You mean to the thumbnail instead of the actual photo ?... that should be easy enuf

try changing (in displayimage.php)
Code:
$picture_url = get_pic_url($CURRENT_PIC_DATA, '');
to
Code:
$picture_url = get_pic_url($CURRENT_PIC_DATA, 'thumb_');
that should do it for about 90% of boards i think and you can also set it to put both the outputs of the thumb and the main image if thats what you want with a little playing about with the code .... let me know if you have any trouble.
Reply With Quote
  #6  
Old 02-14-2006, 12:05 PM
Xzyte Xzyte is offline
 
Join Date: Nov 2005
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you for your help, I actually mean the resized picture which I have set to be 400x400 and is saved in the users folder as "normal_" anyway I tried the code above and it still shows me the link to the original picture on my Coppermine 1.4.3

Thanks for your help!
Reply With Quote
  #7  
Old 02-14-2006, 12:13 PM
DjTaz DjTaz is offline
 
Join Date: Apr 2003
Posts: 251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this so :
Code:
////////////////////////////////////////////////
//// OUTPUT CODES FOR VBCODE AND HTML CODE /////
//////////////// BY DjTaz  (www.djtaz.com)//////
////////////////////////////////////////////////
	$picture_url = get_pic_url($CURRENT_PIC_DATA, '');
	$picture_normal = get_pic_url($CURRENT_PIC_DATA, 'normal_');
	$website = $CONFIG["ecards_more_pic_target"];
	$info[$lang_picinfo['BB Code']] = "<font color=RED></FONT COLOR>";
	$info[$lang_picinfo['HTML Code']] = "<font color=green><XMP> <img src='".$website.$picture_url."'></XMP></font>";
	$info[$lang_picinfo['Normal Photo']] = "<font color=blue><XMP> <img src='".$website.$picture_normal."'></XMP></font>";
////////////////////////////////////////////////
//// END OF VBCODE AND HTML OUTPUT CODE ////////
////////////////////////////////////////////////
and instead of the two in the lang , add in three
Code:
  
  'BB Code' => 'VB Code',
  'HTML Code' => 'HTML Code',
 'Normal Photo' => 'Normal Code',
You should notice that the 'Normal' code will have a 'normal_photoname.jpg' instead of
just 'photoname.jpg' in the link thats given out. If that still doesnt work - give me the exact directories where everything resides and ill see what else i can come up with.
Reply With Quote
  #8  
Old 02-14-2006, 01:09 PM
DjTaz DjTaz is offline
 
Join Date: Apr 2003
Posts: 251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I said i better give you guys this info as well , since it was requested on the Coppermines gallery and adds in nicely to this edit ...

Here is an alternative way to change the displayimage.php so that it has a COPY TO CLIPBOARD for the VBCODE and the HTML Code - makes life easier overall.

use this instead of the original addition above if you like it :
Code:
//// THANKS TO ROSS FOR THE JAVASCRIPT//
?>
<script>
function copy_clip(meintext){
	if (window.clipboardData){
		window.clipboardData.setData("Text", meintext);
	}else if (window.netscape){
		netscape.security.PrivilegeManager.enablePrivilege  ('UniversalXPConnect');

		var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard  );
		if (!clip) return;

		var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
		if (!trans) return;

		trans.addDataFlavor('text/unicode');

		var str = new Object();
		var len = new Object();

		var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
		var copytext=meintext;
		str.data=copytext;
		trans.setTransferData("text/unicode",str,copytext.length*2);
		var clipid=Components.interfaces.nsIClipboard;

		if (!clip) return false;
		clip.setData(trans,null,clipid.kGlobalClipboard);

	}

	return false;
}
//-->
</script>

<?
////////////////////////////////////////////////
//// OUTPUT CODES FOR VBCODE AND HTML CODE /////
//////////////// BY DjTaz  (www.djtaz.com)//////
////////////////////////////////////////////////
	$picture_url = get_pic_url($CURRENT_PIC_DATA, '');
	$website = $CONFIG["ecards_more_pic_target"];
	$info[$lang_picinfo['BB Code']] = "<form name=\"testform1\"><textarea name=\"testsquare1\" cols=35>[IMG] ".$website.$picture_url." [/IMG]</textarea><input type=\"button\" onclick=\"return copy_clip(document.forms[0].testsquare1.value)\" value=\"Copy to Clipboard\"></form>";
	$info[$lang_picinfo['HTML Code']] = "<form name=\"testform2\"><textarea name=\"testsquare2\" cols=35><img src='".$website.$picture_url."'></textarea><input type=\"button\" onclick=\"return copy_clip(document.forms[1].testsquare2.value)\" value=\"Copy to Clipboard\"></form>";

////////////////////////////////////////////////
//// END OF VBCODE AND HTML OUTPUT CODE ////////
////////////////////////////////////////////////
You can see this working here :

http://www.djtaz.com/gallery/display...10294&pos=-107
(for the Copy to clipboard one )

and
http://www.djtaz.com/gallery/display...10294&pos=-107
(for the original one)
Reply With Quote
  #9  
Old 02-16-2006, 01:27 AM
Xzyte Xzyte is offline
 
Join Date: Nov 2005
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I like this option and it works just as good as your first one.

About the normal_ sized pictures, that didn't work for me but never mind, I'm happy with the one above

Thanks again DjTaz!
Reply With Quote
  #10  
Old 02-18-2006, 11:20 PM
DjTaz DjTaz is offline
 
Join Date: Apr 2003
Posts: 251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Xzyte - i u want me to take a look at ur site send me the address - and let me know where the normal_ pics are stored etc etc.


Ill see what i can do to get you that code as well if i can

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 09:35 PM.


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.04549 seconds
  • Memory Usage 2,301KB
  • 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
  • (9)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete