Support Forum Project Downloads FAQ Documentation About Demo Tutorials Blog Plugins
November 21, 2009, 07:38:57 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: cpg1.5.2 beta released
The brand new cpg1.5.x series that comes with a lot of new features finally has reached the release stage: a first public beta release cpg1.5.2 has been released that is mainly aimed at translators, testers and community members that have contributed in the past. The beta release is not meant to be used in a production environment, but only on testbeds and for evaluation purposes. There is currently no support for cpg1.5.x yet!
[more]
   Home   Help Search Board rules Login Register  
Pages: 1 ... 5 6 7 8 [9]   Go Down
  Send this topic  |  Print  
Author Topic: copy/ paste bbcode img URL below intermediate image v1.1  (Read 61414 times)
0 Members and 1 Guest are viewing this topic.
Jixzer
Coppermine newbie

United States United States

Posts: 4


« Reply #160 on: February 25, 2009, 03:25:23 am »

I guess I'm just impatient.  I looked over the code, and though I'm no programmer, I set up a BBcode that would work on my site and implemented it into the plugin given.  Also, I only really wanted this so that users could embed their gallery entries into the forums.  Here's what I did:

Code:
<?php
/**************************************************
  CPG BB Code Plugin for Coppermine Photo Gallery 
  Modified by Zachary Barnes of UselessHacks.com
Now creates html tags instead of BB
  *************************************************
  Copyright (c) 2006 Thomas Lange <stramm@gmx.net>
  *************************************************
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  *************************************************
  Coppermine version: 1.4.9
  BB Code Plugin version: 1.2
  $Revision: 1.0 $
  $Author: stramm $
***************************************************/


if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

// Add a filter
$thisplugin->add_filter('file_data','bbcode_add_data');


function 
bbcode_add_data($pic_data){ //$pic_data
global $CONFIG;

//Javascript to hide hotlinking information along with div arrangement, taken from a common toggling script floating around the net
$script_data = <<< EOT

<script language="javascript" type="text/javascript">
<!--
function toggleLayer(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"block";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"block";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"block";
}
}
//-->
</script>

<br><a href="javascript:toggleLayer('hotlinking');" title="View Hotlinking Information">View Hotlinking Information</a>
<div id="hotlinking" style="display: none; margin: 0px 20px 0px 20px;">

EOT;
    
    
$thumb_url get_pic_url($pic_data'thumb');  //here we grab the url to the thumb url
$int_url get_pic_url($pic_data'normal');  //intermediate pic
$full_url get_pic_url($pic_data'fullsize');            //fullsized pic
$pic_data['title'] ? $name $pic_data['title'] : $name 'No&nbsp;Title'//checking if the pic has a title, if not we set it to 'No title'

//Generating the file paths for each picture size

$fs_url '&#38;#91;img&#38;#93;'.$CONFIG['ecards_more_pic_target'].$full_url.'&#38;#91;&#38;#47;img&#38;#93;';
$ve_url '&#38;#91;flv&#38;#93;'.$CONFIG['ecards_more_pic_target'].$full_url.'&#38;#91;&#38;#47;flv&#38;#93;';
//this just brings everything in form... we create a table etc., 

$bbcode_data $script_data;
$bbcode_data .= '<table align="center" width="600">';

//thumbnail image code with link to intermediate image
$textarea_prop 'name="bbcode" rows="1" cols="75" style="overflow:off; white-space:nowrap" readonly="readonly"';

//fullsize image code
$bbcode_data .= '<tr><td>Fullsize:</td></tr>';
$bbcode_data .= '<tr><td><textarea '.$textarea_prop.'>'.$fs_url.'</textarea></td></tr>';

//video embed code
$bbcode_data .= '<tr><td>Video Embed Code:</td></tr>';
$bbcode_data .= '<tr><td><textarea '.$textarea_prop.'>'.$ve_url.'</textarea></td></tr>';

//closing table and visiblity div
$bbcode_data .= '</table></div>';



//finally we add the created stuff to the picture data and return it to coppermine
$pic_data['html'] = $pic_data['html'].$bbcode_data

return $pic_data
}

?>


Basically, I removed the entire thumbnail string and added an extra variable specifically for my FLV files.  As I allow more video formats, I'll increase the options.  Granted, it's not the most flexible, but it's easy and functional for my users.  Smiley
Logged
Jixzer
Coppermine newbie

United States United States

Posts: 4


« Reply #161 on: February 25, 2009, 03:26:16 am »

Oh, sorry, for an example you can go to http://www.freakingamers.com/gallery/
Logged
tapety_net
Coppermine newbie

Posts: 3


« Reply #162 on: February 28, 2009, 03:38:42 pm »

Hello,

I need modification of bbcode, not like plugin but copy/paste in theme.php in specific place,on intermediate page, below CAPTION, i need:
1. title
2. caption
3. bbcode
4. vote......

Code:
// HTML template for intermediate image display
$template_display_media = <<<EOT
...
...
...
<!-- BEGIN title -->
                                <tr>
                                        <td class="tableb"><center><b>
                                                {TITLE}
                                        </b></center></td>
                                </tr>
<!-- END title -->
<!-- BEGIN caption -->
                                <tr>
                                        <td class="tableb"><center>
                                                {CAPTION}
                                                {BBCODE} --------------------- how to make this <<<<<<<<<<<<<<<<<
                                        </center></td>
                                </tr>
<!-- END caption -->
                        </table>
<!-- END img_desc -->
                </td>
        </tr>
EOT;
Logged
xfantasy
Coppermine newbie

United Kingdom United Kingdom

Posts: 4


« Reply #163 on: March 21, 2009, 04:42:55 am »

Hello guys , i was modify this code for my consuming. I hope that some one gona like...

Code:
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

// Add a filter
$thisplugin->add_filter('file_data','bbcode_add_data');


function bbcode_add_data($pic_data){ //$pic_data
global $CONFIG;

$script_data = <<< EOT

EOT;

$thumb_url = get_pic_url($pic_data, 'thumb');  //here we grab the url to the thumb url
$full_url = 'displayimage.php?pos=-'.$pic_data['pid']; //fullsized pic
$pic_data['title'] ? $name = $pic_data['title'] : $name = 'No&nbsp;Title'; //checking if the pic has a title, if not we set it to 'No title'

//here we define the actual bbcode coppermine path + the path to the pic $img_url is for the version that displays the thumb, $name_url is for a txt link with the ikmage title
    $thu_url = '[url='.$CONFIG['ecards_more_pic_target'].$full_url.'][IMG]'.$CONFIG['ecards_more_pic_target'].$thumb_url.'[/IMG][/url]';
    $im_url = '&lt;a&nbsp;href="'.$CONFIG['ecards_more_pic_target'].$full_url.'"&gt;&lt;img&nbsp;src="'.$CONFIG['ecards_more_pic_target'].$thumb_url.'"&nbsp;alt="'.$name.'"&nbsp;/&gt;&lt;/a&gt;';

//this just brings everything in form... we create a table etc.
$bbcode_data = '<table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';

$bbcode_data .= '<td>Grab Thumbnail For Forum :</td>';
    $bbcode_data .= '<tr><td><textarea name="bbcode" rows="1" cols="50" wrap="off" style="overflow:hidden;height:15px;" onfocus="this.select();" onclick="this.select();">'.$textarea_prop.''.$thu_url.'</textarea></td></tr>';
$bbcode_data .= '</tr><tr>';
$bbcode_data .= '<td>Grab Thumbnail For Blog :</td>';
    $bbcode_data .= '<tr><td><textarea name="bbcode" rows="1" cols="50" wrap="off" style="overflow:hidden;height:15px;" onfocus="this.select();" onclick="this.select();">'.$textarea_prop.''.$im_url.'</textarea></td></tr>';

$bbcode_data .= '</tr></table>';

//finally we add the created stuff to the picture data and return it to coppermine
$pic_data['html'] = $pic_data['html'].$bbcode_data;

return $pic_data;
}
?>

Any comment or suggestion well be helpful  Wink
Logged
Fabricio Ferrero
Dev Team member
****
Gender: Male
Argentina Argentina

Posts: 1927


From San Juan, Argentina, to the World!


WWW
« Reply #164 on: March 21, 2009, 08:25:43 am »

Any comment or suggestion well be helpful  Wink

If so:

  • Post details about the modification and benefit of using your modificated mod.
  • Attach a screenshoot if useful.
  • Post a link to a live demo of it.
Logged

Read Docs and Search the Forum before posting. - Soporte en español
--*--
Fabricio Ferrero's Website
Mi red de Rotaractianos:  Rotaract Latino
xfantasy
Coppermine newbie

United Kingdom United Kingdom

Posts: 4


« Reply #165 on: March 21, 2009, 10:06:25 am »

ok

code description :

1. code showing thumbnail links to add image in forum or blog (my requirement of gallery)
2. when visitor press on it link is highlited ,rigth click copy
3. thumbnail hotlink redirect visitors to gallery where image is posted ( displayimage.php?pos=- )

i just wont to add that i don't know coding , but i was reading topic from beginning. after some time
and mixing couple code of other users i find way to sort proper code what i was looking for.

P.S. i have problem with coper_ad, can any one help me? Huh


* pick1.JPG (19.99 KB, 424x432 - viewed 211 times.)
Logged
Joachim Müller
Administrator
*****
Gender: Male
Germany Germany

Posts: 45051


aka "GauGau"


WWW
« Reply #166 on: March 23, 2009, 06:06:33 pm »

P.S. i have problem with coper_ad, can any one help me? Huh
Definitely not in this thread. Respect board rules!
Logged
bb3
Coppermine novice
*
Philippines Philippines

Posts: 34


« Reply #167 on: March 26, 2009, 12:59:53 pm »

hi there

is there any way of changing the location of bbcode? I want to place it outside the image border.
I want to place it outside the black area. thanks in advance!

here's a link
http://redlens.org/gallery/displayimage.php?album=lastup&cat=0&pos=1
Logged
bb3
Coppermine novice
*
Philippines Philippines

Posts: 34


« Reply #168 on: March 27, 2009, 02:17:56 am »

hi there

is there any way of changing the location of bbcode? I want to place it outside the image border.
I want to place it outside the black area. thanks in advance!

here's a link
http://redlens.org/gallery/displayimage.php?album=lastup&cat=0&pos=1

Please ignore my query. I found the solution

Find
Code:
$pic_data['html'] = $pic_data['html'].$bbcode_data

Change to
Code:
$pic_data['menu'] = $pic_data['menu'].$bbcode_data
Logged
crow5716
Coppermine newbie

United States United States

Posts: 15


WWW
« Reply #169 on: May 31, 2009, 12:20:20 am »

so what value can you use if you are not in an image view. but rather in the album view. how can i pull in the url to my text boxes. just read through this whole post. but $img_url, $pic_url, and $thumb_url are all coming up blank.

here's a link to the page i'm trying to do this on. pretend it's not ugly i haven't skinned it yet

http://bouncingtrucks.com/gallery/thumbnails.php?album=2

i want it to look like the gallery i have now, but i'm trying to do it through coppermine now

here's my current gallery

http://bouncingtrucks.com/Trucks_Chevy_1.html

thanks

-crow
Logged
fotografi
Coppermine novice
*
Posts: 21


« Reply #170 on: August 29, 2009, 01:59:55 am »

Any idea how to add these fields in the File information area, under "Favorites:   Add to Favorites"?!

Logged
Stramm Topic starter
Dev Team member
****
Gender: Male
Posts: 5622



« Reply #171 on: August 29, 2009, 07:17:00 pm »

search the plugins board for an alternative plugin
Logged

my CPG sandbox: Version 1.4.18 with modpack running my Tentacle theme:
http://stramm.st.funpic.org/
lurkalot
Coppermine regular visitor
**
Gender: Male
United Kingdom United Kingdom

Posts: 77


« Reply #172 on: August 30, 2009, 11:59:04 am »

Any idea how to add these fields in the File information area, under "Favorites:   Add to Favorites"?!



yep, use this plugin. HTML Embedding Plugin
Logged

My Website

SMF 1.1.10 Tinyportal 0.9.8 bridged with Coppermine 1.4.23 and CPMFetch 2
Pages: 1 ... 5 6 7 8 [9]   Go Up
  Send this topic  |  Print  
 
Jump to:  

Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC
Page created in 0.062 seconds with 17 queries.