Advanced search  

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

Pages: [1]   Go Down

Author Topic: Make a javascript directly on thumbail [resolved]  (Read 13595 times)

0 Members and 1 Guest are viewing this topic.

Laurenzo

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Make a javascript directly on thumbail [resolved]
« on: January 28, 2005, 01:41:53 am »

Hello all

Coppermine is absolutly great, good job for all community and the team :)

I have a little website (in french but it's not important)

I would, launch the javascrip for open the image in new windows, directly after click on the thumbails.

Sample , now for launch javascript for open the image in new windows, it's in this url :

http://ordigamers.com/screens/displayimage.php?album=4&pos=0

Me, i would launch the javascript for open the image in new windows DIRECTLY at this URL, juste after the click on the thumbails.

http://ordigamers.com/screens/thumbnails.php?album=4 (it's more beautiful no ? ;-) )


It's possible ?

what is the file then you must modify for make that ?


if you can help me, i love you....

Thanks very much
« Last Edit: February 24, 2005, 09:23:34 am by GauGau »
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Make a javascript directly on thumbail...
« Reply #1 on: January 28, 2005, 07:59:48 am »

Do you want that full size image should open in a new window, when clicked on thumbnail? OR do you want that the intermediate image (displayimage.php) should open in a new window?
Logged
Chief Geek at Ranium Systems

Laurenzo

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Make a javascript directly on thumbail...
« Reply #2 on: January 28, 2005, 02:54:42 pm »

thank for your reply

i want that full size image should open in a new window, when clicked on thumbnail....

I have desactivate the intermediate image

thank you for your futur reply...
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Make a javascript directly on thumbail...
« Reply #3 on: January 29, 2005, 07:21:02 am »

For displaying full size image when clicked on thumbnail (Will be applied to all thumbnails and you will not be able to see intermediate image at all) -

In include/functions.inc.php

Add

Code: [Select]
$thumb_list[$i]['pid'] = $row['pid'];
$thumb_list[$i]['pwidth'] = $row['pwidth'];
$thumb_list[$i]['pheight'] = $row['pheight'];

immediately after (somewhere around line 1076 in function display_thumbnails.)

Code: [Select]
$thumb_list[$i]['aid'] = $row['aid'];

In themes/yourtheme/theme.php (You will have to make following changes in all the themes which you use)

($template_thumbnail_view template block) Replace

Code: [Select]
<a href="{LINK_TGT}">{THUMB}<br /></a>

with

Code: [Select]
<a href="{LINK_TGT}" onclick="{ON_CLICK}">{THUMB}<br /></a>

and replace (in function theme_display_thumbnails)

Code: [Select]
$params = array('{CELL_WIDTH}' => $cell_width,
    '{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&pos={$thumb['pos']}",
    '{THUMB}' => $thumb['image'],
    '{CAPTION}' => $thumb['caption'],
    '{ADMIN_MENU}' => $thumb['admin_menu']
    );

with

Code: [Select]
$params = array('{CELL_WIDTH}' => $cell_width,
    '{LINK_TGT}' => "javascript:;",
    '{ON_CLICK}' => "MM_openBrWindow('displayimage.php?pid=".$thumb['pid']."&fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width=".$thumb['pwidth'].",height=".$thumb['pheight']."')",
    '{THUMB}' => $thumb['image'],
    '{CAPTION}' => $thumb['caption'],
    '{ADMIN_MENU}' => $thumb['admin_menu']
    );

Enjoy. :)
Logged
Chief Geek at Ranium Systems

Laurenzo

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Make a javascript directly on thumbail...
« Reply #4 on: January 31, 2005, 08:50:45 pm »

thank you abbas ali, i wil ltry that....

 ;D
Logged

Anne

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Make a javascript directly on thumbail...
« Reply #5 on: February 02, 2005, 12:02:09 pm »

I tried this, and it does what it's supposed to do except image views are no longer logged (as far as I can tell). Is there a way to have image views logged still?
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Make a javascript directly on thumbail...
« Reply #6 on: February 02, 2005, 01:28:08 pm »

Views logging, commenting, voting, slideshow etc.. are all features on intermediate stage pic which we have skipped by showing directly the full size image.

However if you want that the views should be logged when showing full size image, it could be done by modifying the function display_fullsize_pic() in displayimage.php file.
Logged
Chief Geek at Ranium Systems

Anne

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Make a javascript directly on thumbail...
« Reply #7 on: February 02, 2005, 04:06:57 pm »

I'd like to continue logging views, but I don't know what I need to modify the function display_fullsize_pic() to.
Logged

Laurenzo

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Make a javascript directly on thumbail...
« Reply #8 on: February 02, 2005, 07:56:21 pm »

I have triy that, and it's good !!

great manip' !!!

i you would see the result :

http://ordigamers.com/ordi/e107_plugins/coppermine_menu/thumbnails.php?album=5

Thank you abbas ali, i will never found that alone.....
Logged

Anne

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Make a javascript directly on thumbail [resolved]
« Reply #9 on: February 03, 2005, 02:52:12 am »

I took a guess at modifying the displayimage.php and this is what I did:

Code: [Select]
// Display the full size image
function display_fullsize_pic()
{
    global $CONFIG, $HTTP_GET_VARS, $THEME_DIR, $ALBUM_SET;
    global $lang_errors, $lang_fullsize_popup, $lang_charset;

    if (function_exists('theme_display_fullsize_pic')) {
        theme_display_fullsize_pic();
        return;
    }
    // Add 1 to hit counter
    if ($album != "lasthits" && !in_array($pid, $USER['liv']) && isset($HTTP_COOKIE_VARS[$CONFIG['cookie_name'] . '_data'])) {
        add_hit($pid);
        if (count($USER['liv']) > 4) array_shift($USER['liv']);
        array_push($USER['liv'], $pid);
    }

When I checked this, I got this in the pop-up:

Code: [Select]
Warning: in_array(): Wrong datatype for second argument in /home/public_html/gallery/displayimage.php on line 449
Also, I don't think it's logging hits still. Could someone help me with this?
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Make a javascript directly on thumbail [resolved]
« Reply #10 on: February 03, 2005, 06:48:01 am »

Replace above code with

Code: [Select]
// Display the full size image
function display_fullsize_pic()
{
    global $CONFIG, $HTTP_GET_VARS, $THEME_DIR, $ALBUM_SET, $USER, $HTTP_COOKIE_VARS;
    global $lang_errors, $lang_fullsize_popup, $lang_charset;
   
    $pid = $HTTP_GET_VARS['pid'];
   
    // Add 1 to hit counter
    if (!in_array($pid, $USER['liv']) && isset($HTTP_COOKIE_VARS[$CONFIG['cookie_name'] . '_data'])) {
        add_hit($pid);
        if (count($USER['liv']) > 4) array_shift($USER['liv']);
        array_push($USER['liv'], $pid);
        user_save_profile();
    }

    if (function_exists('theme_display_fullsize_pic')) {
        theme_display_fullsize_pic();
        return;
    }

and you will be able to log the views.
Logged
Chief Geek at Ranium Systems

Anne

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Make a javascript directly on thumbail [resolved]
« Reply #11 on: February 03, 2005, 03:52:23 pm »

Thanks, it works perfectly.
Logged

crippe

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 28
    • My photos
Re: Make a javascript directly on thumbail [resolved]
« Reply #12 on: February 23, 2005, 09:38:04 pm »

Hi Abbas Ali,

Thanks for a great mod !!! But I have 1 problem  :\'( I get this when I try it

Code: [Select]
Warning: in_array(): Wrong datatype for second argument in /web/sites/chrisus/thaichix.com/members/coppermine/displayimage.php on line 438

Warning: array_push(): First argument should be an array in /web/sites/chrisus/thaichix.com/members/coppermine/displayimage.php on line 441

Please advice

Sincerely

Crippe


Replace above code with

Code: [Select]
// Display the full size image
function display_fullsize_pic()
{
    global $CONFIG, $HTTP_GET_VARS, $THEME_DIR, $ALBUM_SET, $USER, $HTTP_COOKIE_VARS;
    global $lang_errors, $lang_fullsize_popup, $lang_charset;
   
    $pid = $HTTP_GET_VARS['pid'];
   
    // Add 1 to hit counter
    if (!in_array($pid, $USER['liv']) && isset($HTTP_COOKIE_VARS[$CONFIG['cookie_name'] . '_data'])) {
        add_hit($pid);
        if (count($USER['liv']) > 4) array_shift($USER['liv']);
        array_push($USER['liv'], $pid);
        user_save_profile();
    }

    if (function_exists('theme_display_fullsize_pic')) {
        theme_display_fullsize_pic();
        return;
    }

and you will be able to log the views.
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Make a javascript directly on thumbail [resolved]
« Reply #13 on: February 24, 2005, 06:26:20 am »

Add this code

Code: [Select]
if (!isset($USER['liv']) || !is_array($USER['liv'])) {
    $USER['liv'] = array();
}

just after
Code: [Select]
$pid = $HTTP_GET_VARS['pid'];

in above code. And everything should work hopefully. :)
Logged
Chief Geek at Ranium Systems

crippe

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 28
    • My photos
Re: Make a javascript directly on thumbail [resolved]
« Reply #14 on: February 24, 2005, 11:21:47 am »

Thanks alot!!!!!!!!!

Logged
Pages: [1]   Go Up
 

Page created in 0.047 seconds with 20 queries.