Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorRob
    • CommentTimeOct 19th 2010
     
    Hi All

    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
    • CommentAuthorchewbears
    • CommentTimeOct 21st 2010 edited
     
    <img src="your pictur" /><br><a href="your link">MY LINK</a>
    Thankful People: Rob
    • CommentAuthorRob
    • CommentTimeOct 31st 2010
     
    Hi Chewbears

    Thanks for the information. Could you please tell me which file I need to edit with this info?

    Thanks again.

    Rob
    • CommentAuthorchewbears
    • CommentTimeNov 1st 2010
     
    You physically would type that code in when you made a post or such on a website. So if they click the text below the picture they go to that picture in your web page.

    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?
    • CommentAuthorfloriske.nl
    • CommentTimeNov 2nd 2010 edited
     
    @chewbears: most bulletin boards use (U)BB code for placing images and links e.g.

    [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)
    • CommentAuthorRob
    • CommentTimeNov 2nd 2010
     
    Hi Floriske

    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
    • CommentAuthorfloriske.nl
    • CommentTimeNov 3rd 2010 edited
     
    On my own site it's custom to work with the Galleriffic script, but I've re-written it to work with the default theme:

    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
    Thankful People: Rob
    • CommentAuthorRob
    • CommentTimeNov 3rd 2010
     
    Hi Floriske

    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
  1.  
    You're welcome ;)

    I don't have much php knowledge, but this one wasn't too hard to figure out.
    Mostly copy, paste and change work.
    • CommentAuthorfloriske.nl
    • CommentTimeNov 8th 2010 edited
     
    Rob, did you manage to get this working as well? Good to give some feedback so others can implement this as well if they'd like to.