Suggestion on Skin Concept Suggestion on Skin Concept
 

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]

Main Menu

Suggestion on Skin Concept

Started by pols1337, February 25, 2013, 08:06:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pols1337

Hey folks, I haven't visited in awhile but looks like ya'll are staying busy.  Keep up the good work!  :)

I'd like to start a new Coppermine gallery, but I'd like the theme to be completely stripped of categories and albums (although they can still work in the backend).  All I want is a single, random, large-size image for people to vote.  Once a user votes, another single, random, large-size image appears.  It would be almost like Coppermine's displayimage.php but the pictures would be in random sequence. 

Can this be done with any current skin or setup?  I know Coppermine isn't originally set up this way, but I like this photo gallery software the most and I trust it.  I'm looking into JAlbum and Piwigo (but I feel dirty for cheating on Coppermine  :-[)

Αndré

You don't want to provide any other elements than just this
Quote from: pols1337 on February 25, 2013, 08:06:18 PM
single, random, large-size image
right?

I assume the easiest way would be to use something like the attached file as index.php file. We'd need to add
Quote from: pols1337 on February 25, 2013, 08:06:18 PM
Once a user votes, another single, random, large-size image appears.
depending if you prefer to use the old or new rating system.

pols1337

Hi Andre,

Whoo I'm excited!  I tried out your index.php -- yes this is exactly what I want!  ;) ;) I'm not really sure about the difference between the old and new rating system, but I'm guessing new one would be better.  If possible, I would like the voting to automatically trigger the next picture so that once you vote, the page automatically refreshes to the next picture. 

You can see it in action at my Test Gallery: www.adonismale.com/tg/

Αndré

I just noticed that $RESTRICTEDWHERE is empty in my provided index.php file (which is actually almost a one-to-one copy of displayimage.php). To fix any permission issues, you should find
$pid = mysql_result(cpg_db_query("SELECT pid FROM {$CONFIG['TABLE_PICTURES']} $RESTRICTEDWHERE ORDER BY RAND() LIMIT 1"), 0);
and replace with
get_meta_album_set(0);
$pid = mysql_result(cpg_db_query("SELECT pid FROM {$CONFIG['TABLE_PICTURES']} AS r $RESTRICTEDWHERE ORDER BY RAND() LIMIT 1"), 0);



Quote from: pols1337 on February 26, 2013, 11:31:49 AM
I would like the voting to automatically trigger the next picture so that once you vote, the page automatically refreshes to the next picture.
Open js/displayimage.js, find
        displayStars();
(inside the function rate) and below, add
        window.location.href = 'index.php';

pols1337

Whoooo -- this is beautiful!  I've made the changes you suggested and it's stunning.  You can check out my demo here: http://adonismale.com/tg/index.php

Okay, two more minor enhancements:
1) What if I'd like to show the picture description underneath?  (And by the way, does CPG allow links in descriptions?)
2) What if I'd like to show the average rating underneath?   

For anybody else who would like to replicate these settings, see attached files.  Instructions:
1) Upload and over-write index.php into your server's main coppermine/ folder
2) Upload and over-write displayimage.js into coppermine/js/ folder

Αndré

Your demo gallery is password protected.

Quote from: pols1337 on February 26, 2013, 02:29:09 PM
Whoooo -- this is beautiful!  I've made the changes you suggested and it's stunning.  You can check out my demo here: http://adonismale.com/tg/index.php
1) What if I'd like to show the picture description underneath?
2) What if I'd like to show the average rating underneath?   
That's default behavior.


Quote from: pols1337 on February 26, 2013, 02:29:09 PM
does CPG allow links in descriptions?
You can use the BBCode tag url.

pols1337

Mmm, I'm not sure how to get around the password protection.  I'm bridging with IPB so it's kind of weird, but maybe just try to go to the link again:
http://adonismale.com/tg/index.php.  All I can say is that it's stunning  ;)

I figured out in the Config how to show ratings.  Thanks. 

This project is /resolved.  Thanks for all of your help Αndré

P.S.  You might want to package this into a "CPG Slideshow" as a skin or something. 

pols1337

You can check out the working demo here:
http://adonismale.com/tg/index.php

(Allowed multiple votes according to thread here)

Also disabled bridging so people could actually see how beautiful it is. 

pols1337

Hi Andre,

I need another fix to the index.php page: it really needs to show the anycontent file.

Please advise. 


Αndré

Add
include('anycontent.php');
before or after
theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip);
depending where it should be displayed.

pols1337

Hey Andre,

Would it be possible for you to make a minor modification to the index.php page?  I've noticed that the voting is so far down, it requires the user to scroll down on the page.  (You don't need to scroll down a lot, but you still need to scroll down.  This adds an extra action to the user, and it would be a lot smoother in terms of the overall experience if it could be bypassed).  Thus, I was wondering if you could move the voting *above* the picture, and add commenting beneath it. 

I tried to copy and paste and move stuff around myself.  That didn't work out so well.   :-\

Attached: index.php

Αndré

I'm not sure where the comments should be placed. Above or below the picture?

pols1337


Αndré

Copy the function theme_display_image from themes/sample/theme.php to your theme's theme.php file, if it doesn't exist. Then, find
    starttable();
    echo $picture;
    endtable();
    if ($CONFIG['display_film_strip'] == 1) {
        echo $film_strip;
    }


    echo $votes;

and replace with
    echo $votes;

    starttable();
    echo $picture;
    endtable();
    if ($CONFIG['display_film_strip'] == 1) {
        echo $film_strip;
    }


As you can see it's a very simple mod by just moving one line. It's also possible to copy the function directly to your index.php file, but this is not recommended as you'll get an error message if your theme's theme.php file also contains that function.

pols1337