Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: [feat. request] Replace comments with an hiden DIV ( or popup ? )  (Read 5602 times)

0 Members and 1 Guest are viewing this topic.

protox

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 49
  • Digital Photographer
    • x-poz
[feat. request] Replace comments with an hiden DIV ( or popup ? )
« on: September 20, 2005, 04:49:44 pm »

Stramm has just released a code to replace emoticons with a popup window ( see it there )
But I'd like to get a cleaner way to publish the photography; without any disturbing comments under 'em :o ;D

So, the visitors will have to click on a link to unhide the comments ( or open a popup window ? don't know if it's more difficult to make it or not )

--

And the most beautiful dream @ the moment could be to have the same for the votes !
Oh yes I know I'm a dreaaaaamer :P
Logged
Latest shot from " Les disséqueurs de société " :

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fx-poz.org%2Fcpmfetch%2Fcfimageget.php%3Fcmd%3Dlast&hash=6c9ccde658006a5ed432bbbd56630302b3cb9b7d)

Rodinou

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 346
  • Tournicoti, Tournicota
    • http://www.sortons.net
Re: [feat. request] Replace comments with an hiden DIV ( or popup ? )
« Reply #1 on: September 20, 2005, 06:03:44 pm »

Like very much your layout and the photos which are inside Protox

What a pity you hide Powered by Coppermine with a link which has the same color than the background.

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: [feat. request] Replace comments with an hiden DIV ( or popup ? )
« Reply #2 on: September 20, 2005, 07:12:03 pm »

something that gives you an idea on how it works... not 100% (cause atm it can't show you if there are comments to see or just the comment add box) but it works (classic theme).

theme.php find function theme_display_image

a few lines below you'll see

Code: [Select]
    starttable();
    echo $votes;
    endtable();

replace with
Code: [Select]
echo <<<EOT
<script language="JavaScript">
function expand(id)
{
    var item  = document.getElementById(id);
    if( item.style.visibility == 'hidden' )
    {
        item.style.position   = 'relative';
        item.style.visibility = 'visible';
       
    }
    else
    {
        item.style.visibility = 'hidden';
        item.style.position   = 'absolute';
    }
    return false;
}
</script>


<a href="" onClick="return expand('votes');" class="link">[click to show votes]</a><br />
<table id="votes" style="position: absolute; visibility: hidden;"><tr><td>
EOT;
    starttable();
    echo $votes;
    endtable();
echo "</td></tr></table>";

few lines below
Code: [Select]
    starttable();
    echo $comments;
    endtable();
replace with
Code: [Select]
echo <<<EOT
<a href="" onClick="return expand('comments');" class="link">[click to show comments]</a><br />
<table id="comments" style="position: absolute; visibility: hidden;"><tr><td>
EOT;
    starttable();
    echo $comments;
    endtable();
echo "</table></td></tr>";

Rodinou

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 346
  • Tournicoti, Tournicota
    • http://www.sortons.net
Re: [feat. request] Replace comments with an hiden DIV ( or popup ? )
« Reply #3 on: September 20, 2005, 10:23:24 pm »

If I can say something ... :)

it's better to show/hide layer to use DISPLAY (block/none) than VISIBILITY (visible/hidden)

Because when you have some content inside a div, the hidden layer (by visibility scheme) "keeps" the height of the content !!! But using display : none, if your layer is 10px or 3000 px, it's really "hidden".

item.style.visibility = 'hidden'; by item.style.display = 'none';

protox

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 49
  • Digital Photographer
    • x-poz
Re: [feat. request] Replace comments with an hiden DIV ( or popup ? )
« Reply #4 on: September 24, 2005, 11:47:49 am »

[...]
it can't show you if there are comments to see or just the comment add box) but it works (classic theme)
[...]

AGAIN, EXCELLENT WORK STRAMM ! ;D

( but anyway with this code we couldn't have something like :
(6) Comments <--- ALT -- click here to display all the comments in a popup window )

Edit : the code is working nicely with the "item.style.visibility = 'visible';" method,
but it might be better with a detection of the browsing method..
> Example 1 : the user is browsing the most voted, so the vote are direclty diplayed,
> Example 2 : the user is browsing the last commented, so the comments are direclty diplayed,

Do you think that it's hard to code ?
« Last Edit: September 24, 2005, 02:48:01 pm by protox »
Logged
Latest shot from " Les disséqueurs de société " :

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fx-poz.org%2Fcpmfetch%2Fcfimageget.php%3Fcmd%3Dlast&hash=6c9ccde658006a5ed432bbbd56630302b3cb9b7d)

isloera

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 22
    • Calvilloweb.com
Re: [feat. request] Replace comments with an hiden DIV ( or popup ? )
« Reply #5 on: February 26, 2006, 06:51:47 am »

Quote
( but anyway with this code we couldn't have something like :
(6) Comments <--- ALT -- click here to display all the comments in a popup window )

In my signature is the link to a mod that will achieve this part.  ;)
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 19 queries.