Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - fgallery

Pages: [1]
1
How can I place another button before "Lightbox" "eCard" "Download" "Download (Zip)" ?
The button should support languages and shoud also be inactive for unregistered users.


I've found the code for lightbox button in includes/functions.php and tried to write a similar one for my button
but it doesn't work :(
Here's the code:
Code: [Select]
if ($user_info['user_level'] != GUEST) {
      $postit_button = "<img src=\"".get_gallery_image("postit_off.gif")."\" border=\"0\" alt=\"\" />";
    }
    else {
           $postit_button = "<img src=\"".get_gallery_image("postit.gif")."\" border=\"0\" alt=\"\" />";    }

Any ideas why itsn't working ?

2
Mods & Plugins (Releases & Support) / [MOD] Post It! (updated 08.01.2006)
« on: November 08, 2005, 01:19:38 PM »
Idea
The idea is that visitors would have possibility to post images from your gallery anywhere in the Internet (forums, guestbook, blogs, livejournal, etc.)
To perform this we need a new button called for e.g "Post It!" under every single image.
Once the button is pressed pop-up window will show-up.

The window will contain 4 different posting codes:
1) Large version of an image linked to the corresponding page on your site;
2) Thumbnail linked to the corresponding page with large version on your site;
3) Large version linked to the corresponding page on your gallery behind lj-cut;
4) Thumbnail before lj-cut; large version linked to the corresponding page on your gallery behind lj-cut;

Options 3,4 would be useful for posting in livejournal (http://livejournal.com).

Installation

1)Create new file named postit.php in your 4images root directroy; put this code to the file:
Code: [Select]
<?php
$site_url
"http://www.yourpage.com"
?>


<html>
<head>
<title>Post-it</title>
<style type="text/css">
/* A code block - maybe even PHP ;). */
.code
{
color: #000000;
background-color: #FFFFFF;
border: 1px solid #000000;
padding: 3px;
padding-bottom: 20px;
font-family: "courier new", helvetica, "times new roman", serif;
/*  font-family: Courier, 'Courier New', sans-serif, helvetica, "times new roman", serif;*/
font-size: x-small;
width: 98%;
max-height: 24em;
margin: 1px auto 1px auto;

/*margin-top: 4px;*/
white-space: nowrap;
overflow: auto;
line-height: 1.3em;
}
.codeheader
{
color: #000000;
text-decoration: none;
font-style: normal;
font-weight: bold;
font-size: small;
}
</style>
</head>

<?php
$cat_id 
$_GET["cat_id"];
$thumb $_GET["thumb"];
$image "data/thumbnails/$cat_id/$thumb";                
$size getimagesize("$image");
$thumb_height $size[1];
$thumb_width $size[0];
$thumb_width_height = (!empty($size[3])) ? " ".$size[3] : "";
$thumb_height $size[1];
$thumb_width $size[0];
?>


<body>
<div class="codeheader">Thumbnail linked to the corresponding page:</div>
<div class="code">&lt;a href=&quot;<?php echo $_GET["url"]; ?>&quot;&gt;<br />
&lt;img src=&quot;<?php echo $site_url?>/data/thumbnails/<?php echo $_GET["cat_id"]; ?>/<?php echo $_GET["thumb"]; ?>&quot; <?php echo $thumb_width_height?> border=&quot;0&quot; alt=&quot;<?php echo $_GET["name"]; ?>&quot; title=&quot;<?php echo $_GET["name"]; ?>&quot; /&gt;&lt;/a&gt;</div><br />

<div class="codeheader">Large version linked to the corresponding page:</div>
<div class="code">&lt;a href=&quot;<?php echo $_GET["url"]; ?>&quot;&gt;<br />
&lt;img src=&quot;<?php echo $site_url?>/data/media/<?php echo $_GET["cat_id"]; ?>/<?php echo $_GET["media_url"]; ?>&quot; width=&quot;<?php echo $_GET["width"]; ?>&quot; height=&quot;<?php echo $_GET["height"]; ?>&quot; border=&quot;0&quot; alt=&quot;<?php echo $_GET["name"]; ?>&quot; title=&quot;<?php echo $_GET["name"]; ?>&quot; /&gt;&lt;/a&gt;</div><br /><br />

<div class="codeheader">Large version linked to the corresponding page behind lj-cut:</div>
<div class="code">&lt;lj-cut text=&quot;<?php echo $_GET["name"]; ?> - <?php echo $_GET["width"]; ?> x <?php echo $_GET["height"]; ?> - <?php echo $_GET["size"]; ?>&quot;&gt;<br />&lt;a href=&quot;<?php echo $_GET["url"]; ?>&quot;&gt;<br />
&lt;img src=&quot;<?php echo $site_url?>/data/media/<?php echo $_GET["cat_id"]; ?>/<?php echo $_GET["media_url"]; ?>&quot; width=&quot;<?php echo $_GET["width"]; ?>&quot; height=&quot;<?php echo $_GET["height"]; ?>&quot; border=&quot;0&quot; alt=&quot;<?php echo $_GET["name"]; ?>&quot; title=&quot;<?php echo $_GET["name"]; ?>&quot; /&gt;&lt;/a&gt;</div><br /><br />

<div class="codeheader">Thumbnail before lj-cut; large version linked to the corresponding page behind lj-cut:</div>
<div class="code">&lt;img src=&quot;<?php echo $site_url?>/data/thumbnails/<?php echo $_GET["cat_id"]; ?>/<?php echo $_GET["thumb"]; ?>&quot; <?php echo $thumb_width_height?> border=&quot;0&quot; alt=&quot;<?php echo $_GET["name"]; ?>&quot; title=&quot;<?php echo $_GET["name"]; ?>&quot; /&gt;<br />
&lt;lj-cut text=&quot;<?php echo $_GET["name"]; ?> - <?php echo $_GET["width"]; ?> x <?php echo $_GET["height"]; ?> - <?php echo $_GET["size"]; ?>&quot;&gt;<br />
&lt;a href=&quot;<?php echo $_GET["url"]; ?>&quot;&gt;<br />
&lt;img src=&quot;<?php echo $site_url?>/data/media/<?php echo $_GET["cat_id"]; ?>/<?php echo $_GET["media_url"]; ?>&quot; width=&quot;<?php echo $_GET["width"]; ?>&quot; height=&quot;<?php echo $_GET["height"]; ?>&quot; border=&quot;0&quot; alt=&quot;<?php echo $_GET["name"]; ?>&quot; title=&quot;<?php echo $_GET["name"]; ?>&quot; /&gt;&lt;/a&gt;<br />
&lt;/lj-cut&gt;</div>
</body>
</html>
*Change $site_url= "http://www.yourpage.com" !

2)Open includes/functions.php
Find:
Code: [Select]
  else {
    $user_name = $lang['userlevel_guest'];
    $user_name_link = $user_name;
  }

Add below:
Code: [Select]
if ($detailed_view) {
   $site_template->register_vars(array(
     "media_thumbnail" => $image_row['image_thumb_file'],
     "media_url" => $image_row['image_media_file'],
   ));
}

3)Unzip 'posit_buttons' archive and upload postit.gif and postit_off.gif to your template images directory (usually '/templates/templatename/images_language')
You can also use hot_link_button pack.
The archives are attached to this post.


4)
Open templates/{your_template}/details.html and put this code where you want "Post It!" button to appear.
Code: [Select]
{if user_loggedin}<A HREF="javascript:popUp('/postit.php?url='+escape(window.location.href)+'&name={image_name}&cat_id={cat_id}&media_url={media_url}&thumb={media_thumbnail}&height={height}&width={width}&size={image_file_size}')"><img src="{template_lang_image_url}/postit.gif"></a>{endif user_loggedin}{if user_loggedout}<img src="{template_lang_image_url}/postit_off.gif">{endif user_loggedout}
5)Open templates/{your_template}/header.html
Find:
Code: [Select]
</head>Add above:
Code: [Select]
<script language="JavaScript">
<!-- PostIt! Pop-Up Window Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=600,left = 390,top = 212');");
}
// PostIt! Pop-Up Window End -->
</script>

Credits
-Original code by ruudvroon.
-Buttons by maxpaul.
-Some code parts by V@no.

Thank you guys!

This MOD is still improving and if you have any thoughts about it feel free to comment here (http://www.4homepages.de/forum/index.php?topic=10284.msg50913#msg50913)

3
Mods & Plugins (Requests & Discussions) / [Req] "Post It!"
« on: November 02, 2005, 08:00:10 PM »
Idea
The idea is that visitors would have possibility to post images from your gallery anywhere in the Internet (forums, guestbook, blogs, livejournal, etc.)
To perform this we need a new button called for e.g "Post It!" under every single image.
Once the button is pressed pop-up window will show-up.

The window will contain 4 different posting codes:
1) Large version of an image linked to the corresponding page on your site;
2) Thumbnail linked to the corresponding page with large version on your site;
3) Large version linked to the corresponding page on your gallery behind lj-cut;
4) Thumbnail before lj-cut; large version linked to the corresponding page on your gallery behind lj-cut;

Options 3,4 would be useful for positing in livejournal (http://livejournal.com).

The code will look like this
1)
Code: [Select]
<a href="http://www.yoursite.com/img#.htm"><img src="http://www.yoursite.com/data/thumbnails/cat#/thumbnail_name.extension" width="" height="" border"0" alt="image_name" title="image_name /></a>2)
Code: [Select]
<a href="http://www.yoursite.com/img#.htm"><img src="http://www.yoursite.com/data/media/cat#/image_name.extension" width="" height="" border"0" alt="image_name" title="image_name /></a>
3)
Code: [Select]
<lj-cut text="image_name - image_width x image_height - image_size">
<a href="http://www.yoursite.com/img#.htm"><img src="http://www.yoursite.com/data/media/cat#/image_name.extension" width="" height="" border"0" alt="image_name" title="image_name /></a>

4)
Code: [Select]
<img src="http://www.yoursite.com/data/thumbnails/cat#/thumbnail_name.extension" width="" height="" border"0" alt="image_name" title="image_name />
<lj-cut text="image_name - image_width x image_height - image_size">
<a href="http://www.yoursite.com/img#.htm"><img src="http://www.yoursite.com/data/media/cat#/image_name.extension" width="" height="" border"0" alt="image_name" title="image_name /></a>
</lj-cut>
*mod-rewrite is enabled (read about this mod http://www.4homepages.de/forum/index.php?topic=6729.0)
*image_name, image_size - should be taken from 4images db fields
*image_width, image_height - i guess the mod will have to determine them...

Target
- Increase site popularity.

Possible problems
- Traffic overruns (your site have to be really pop ;)

If you can write this mod I have 30$ on my webmoney (http://wmtransfer.com/) account and I would gladly
share them with you !
Update: The MOD was successfully written by ruudvroon he gets 30 WMZ.

Known issues
- Doesn't work with images hosted remotely

Things to improve
- Statistics for "Post It!" in ACP and in top.php
- Post all images in category at once

PS.If you have any thoughts about this, please comment !

Pages: [1]