Announcement

#1 2009-09-02 10:12:29

Sinux
Member
2009-09-02
7

How to make the permissions view full-size pic to be logined-only?

i want encourage visitors register my site in this way.
because many people google a word for a picture , they found my site , got a copy and be off , but never return .
so i want make a guest could only view thumbnail , when click a thumbnail they were noticed to login or register.
how to do ? Or extensions can do this?
i know some php , if no easy way , a code hack could be fine .

Offline

 

#2 2009-09-02 10:55:08

Sinux
Member
2009-09-02
7

Re: How to make the permissions view full-size pic to be logined-only?

http://piwigo.org/forum/viewtopic.php?id=14873
i found this and do as plg told , and remove the hight , but nothing happened

Offline

 

#3 2009-09-02 11:22:58

Sinux
Member
2009-09-02
7

Re: How to make the permissions view full-size pic to be logined-only?

oh a pic have 3 views type , i know now
but  pics  in 'pwg_high' folder(the same as the source pics) smaller than the out of one. why ?

Offline

 

#4 2009-09-02 15:51:03

flop25
Piwigo Team
2006-07-06
7037

Re: How to make the permissions view full-size pic to be logined-only?

Sinux wrote:

oh a pic have 3 views type , i know now
but  pics  in 'pwg_high' folder(the same as the source pics) smaller than the out of one. why ?

pwg_high folder must host the hight def pictures or there would be no reason to do it


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#5 2009-09-02 16:07:40

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: How to make the permissions view full-size pic to be logined-only?

A simple way is making a template-extension to replace the default picture_content.tpl
Please, make a search to find how to use template-extensions or ask in another topic if you don't know.

Instead of coding:

Code:

<img src="{$SRC_IMG}" style="width:{$WIDTH_IMG}px;height:{$HEIGHT_IMG}px;" alt="{$ALT_IMG}"

You can replace width:{$WIDTH_IMG}px by something like:

width:{if is_a_guest()}{math equation="floor(x/3)" x=$WIDTH_IMG}{else}{$WIDTH_IMG}{/if}px

(divide the size by 3 or more, and follow this solution for the height too).
I didn't try it but I am sure you could be satisfied with it.
Enjoy!

Note: avoid adding space or newline in the above code (may have a direct impact on the result).

Source: http://smarty.net/manual/en/language.function.math.php
(Please read technical notes)
is_a_guest() is a Piwigo-function always available at this stage.


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#6 2009-09-03 03:39:59

Sinux
Member
2009-09-02
7

Re: How to make the permissions view full-size pic to be logined-only?

(⊙o⊙)
thank you!!

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact