Plogger Support Forum - HTML or BBCode links? Thu, 28 Mar 2024 22:00:24 +0000 http://www.plogger.org/forum/ Lussumo Vanilla 1.1.10 HTML or BBCode links? http://www.plogger.org/forum/comments.php?DiscussionID=3419&Focus=13386#Comment_13386 http://www.plogger.org/forum/comments.php?DiscussionID=3419&Focus=13386#Comment_13386 Tue, 19 Oct 2010 19:09:51 +0000 Rob
I have just set up a Plogger instance on a web server which I am hoping to hotlink to when I use my images in forums and on my other sites. Is there a way to add either a HTML or BBCode or both links underneath the image when displayed?

Thanks in advance

Rob]]>
HTML or BBCode links? http://www.plogger.org/forum/comments.php?DiscussionID=3419&Focus=13399#Comment_13399 http://www.plogger.org/forum/comments.php?DiscussionID=3419&Focus=13399#Comment_13399 Thu, 21 Oct 2010 13:24:02 +0000 chewbears HTML or BBCode links? http://www.plogger.org/forum/comments.php?DiscussionID=3419&Focus=13438#Comment_13438 http://www.plogger.org/forum/comments.php?DiscussionID=3419&Focus=13438#Comment_13438 Sun, 31 Oct 2010 16:04:21 +0000 Rob
Thanks for the information. Could you please tell me which file I need to edit with this info?

Thanks again.

Rob]]>
HTML or BBCode links? http://www.plogger.org/forum/comments.php?DiscussionID=3419&Focus=13443#Comment_13443 http://www.plogger.org/forum/comments.php?DiscussionID=3419&Focus=13443#Comment_13443 Mon, 01 Nov 2010 12:43:18 +0000 chewbears
A picture in a post is <img src="your pictur" />

That is the html code. You would then add a link to it which in html is the <a href="your link"> then close the code </a> the <br> in between is a line break so the text would go under the picture. Make sense or you wanted something different?]]>
HTML or BBCode links? http://www.plogger.org/forum/comments.php?DiscussionID=3419&Focus=13447#Comment_13447 http://www.plogger.org/forum/comments.php?DiscussionID=3419&Focus=13447#Comment_13447 Tue, 02 Nov 2010 08:54:47 +0000 floriske.nl
[url=http://www.myhomepage.com]my homepage[/url]

or

[img]http://www.myhomepage.com/images.image.jpg[/img]

@ Rob: have a look at my page:

http://www.floriske.nl/index.php?page=photography <-work in progress!

what you are looking for is this the same as I have done with the "Generate BB-Code for this photo" link?

Basically wat it does is generate:

[image intermediate thumbnail]
[image title] (with link to large image) by [photographer] (with link to my homepage)]]>
HTML or BBCode links? http://www.plogger.org/forum/comments.php?DiscussionID=3419&Focus=13449#Comment_13449 http://www.plogger.org/forum/comments.php?DiscussionID=3419&Focus=13449#Comment_13449 Tue, 02 Nov 2010 15:22:36 +0000 Rob
Very nice work on your site. I especially like the upside down header.. very nice effect.

And, yes, that is basically what I am after. May I ask how you have made this?

Thanks

Rob]]>
HTML or BBCode links? http://www.plogger.org/forum/comments.php?DiscussionID=3419&Focus=13451#Comment_13451 http://www.plogger.org/forum/comments.php?DiscussionID=3419&Focus=13451#Comment_13451 Wed, 03 Nov 2010 11:49:55 +0000 floriske.nl
First in the file "theme_functions.php" file in the "plogger/themes/default" folder add


function plogger_get_bbcode_link() {
return '<a accesskey="b" title="'.plog_tr('Generate BB-code').'" href="#" onclick="flip(\'show_bbcode-table\'); return false;">'.plog_tr('Generate BB-code').'</a>';
}

function generate_bbcode_table($id) {
global $config;
$query = "SELECT * FROM `".PLOGGER_TABLE_PREFIX."pictures` WHERE `id`=".intval($id);
$result = run_query($query);
if (mysql_num_rows($result) > 0) {
$row = mysql_fetch_assoc($result);
foreach($row as $key => $val) if (trim($row[$key]) == '') $row[$key] = '&nbsp;';

//generate title
if ($row['caption'] != "") {
$title = $row['caption'];
}
else {
$title = "Photo";
}

// generate thumbnail link
$thumbnail_link = plogger_get_picture_thumb(THUMB_LARGE);

// generate link to the image in your gallery (comment out the next line if you use the link to the large image)
$image_link = $config['gallery_url'].'index.php?level=picture&id='.$id;

// generate link to the large image (comment out the next two lines if you use the link to the image in your gallery)
// $path = $row['path'];
// $image_link = $config['gallery_url'].'plog-content/images/'.$path;

// set "taken by" to be displayed in bb-code
$taken_by = "Your name";
$taken_by_url = "http://www.yourhomepage.com";

$table_data = "\t\t\t\t\t\t" . '<div id="show_bbcode-table">
<script type="text/javascript">flip(\'show_bbcode-table\');</script>
<table id="exif-data">
<tr>
<td colspan="2" class="">BB-Code</td>
</tr>
<tr>
<td>
<textarea name="" class="bbcode">[img]'.$thumbnail_link.'[/img]
[url='.$image_link.']'.$title.'[/url] by [url='.$taken_by_url.']'.$taken_by.'[/url]</textarea>
</td>
</tr>
</table>
' . "\n";
}
return $table_data;
}


make sure the ?> remains at the end of the document!

in the above code change


$taken_by = "Your name";
$taken_by_url = "http://www.yourhomepage.com";


to your wishes

If you want to link to the original large image instead of the image in your gallery change


// generate link to the image in your gallery (comment out the next line if you use the link to the large image)
$image_link = $config['gallery_url'].'index.php?level=picture&id='.$id;

// generate link to the large image (comment out the next two lines if you use the link to the image in your gallery)
// $path = $row['path'];
// $image_link = $config['gallery_url'].'plog-content/images/'.$path;


to


// generate link to the image in your gallery (comment out the next line if you use the link to the large image)
// $image_link = $config['gallery_url'].'index.php?level=picture&id='.$id;

// generate link to the large image (comment out the next two lines if you use the link to the image in your gallery)
$path = $row['path'];
$image_link = $config['gallery_url'].'plog-content/images/'.$path;





Next, add to the "gallery.css" file in the same folder:


#bb-code-toggle {
width: 100%;
text-align: center;
padding: 0;
margin: 0;
}

#bb-code-container {
width: 550px;
margin: 10px auto;
text-align: center;
padding: 10px;
}

.bbcode {
width: 100%;
height: 150px;
}





And finally in the picture.php file change:

<p id="exif-toggle"><?php echo plogger_get_detail_link(); ?></p>
<div id="exif-data-container">
<?php echo generate_exif_table(plogger_get_picture_id()); ?>
</div><!-- /exif-data-container -->


to


<p id="exif-toggle"><?php echo plogger_get_detail_link(); ?></p>
<div id="exif-data-container">
<?php echo generate_exif_table(plogger_get_picture_id()); ?>
</div><!-- /exif-data-container -->

<p id="bb-code-toggle"><?php echo plogger_get_bbcode_link(); ?></p>
<div id="bb-code-container">
<?php echo generate_bbcode_table(plogger_get_picture_id()); ?>
</div><!-- /bb-code-container -->


et voilla]]>
HTML or BBCode links? http://www.plogger.org/forum/comments.php?DiscussionID=3419&Focus=13454#Comment_13454 http://www.plogger.org/forum/comments.php?DiscussionID=3419&Focus=13454#Comment_13454 Wed, 03 Nov 2010 16:22:45 +0000 Rob
That is magnificent. I should be able to work out from here how to get that in. Thanks again for sharing your hard work :)

Cheers

Rob]]>
HTML or BBCode links? http://www.plogger.org/forum/comments.php?DiscussionID=3419&Focus=13456#Comment_13456 http://www.plogger.org/forum/comments.php?DiscussionID=3419&Focus=13456#Comment_13456 Thu, 04 Nov 2010 11:12:26 +0000 floriske.nl
I don't have much php knowledge, but this one wasn't too hard to figure out.
Mostly copy, paste and change work.]]>
HTML or BBCode links? http://www.plogger.org/forum/comments.php?DiscussionID=3419&Focus=13465#Comment_13465 http://www.plogger.org/forum/comments.php?DiscussionID=3419&Focus=13465#Comment_13465 Mon, 08 Nov 2010 09:48:52 +0000 floriske.nl