[feat. request] Replace comments with an hiden DIV ( or popup ? ) [feat. request] Replace comments with an hiden DIV ( or popup ? )
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

[feat. request] Replace comments with an hiden DIV ( or popup ? )

Started by protox, September 20, 2005, 04:49:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

protox

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
Latest shot from " Les disséqueurs de société " :

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

Rodinou

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

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

    starttable();
    echo $votes;
    endtable();


replace with

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

    starttable();
    echo $comments;
    endtable();

replace with

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

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

Quote from: Stramm on September 20, 2005, 07:12:03 PM
[...]
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 ?
Latest shot from " Les disséqueurs de société " :

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

isloera

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.  ;)