Author Topic: Bilder aufrufe / Image Views  (Read 7497 times)

0 Members and 1 Guest are viewing this topic.

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.805
  • I ♥ 4I
    • View Profile
Bilder aufrufe / Image Views
« on: October 13, 2011, 11:01:25 PM »
Hallo zusammen,

wenn man in der Detailansicht die Aufrufe der Bilder ansieht, steht dort nur die Nummer.

Ist es möglich, das man das ausrechnen kann wie viele Aufrufe pro Tag stattgefunden haben?

Beispiel:
Original: Das Bild wurde 1 mal aufgerufen
Idee: Dieses Bild wurde bereits 1 mal (0,5 Aufrufe pro Tag) angesehen.

--

Hi all,

if you are in the detail view looks at the views of the pictures, there is only the number.

Is it possible that we can calculate the number of visits per day take place?

example:
Original: The image was viewed 1 times
Idea: This image has been viewed 1 times (0.5 views per day).

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Bilder aufrufe / Image Views
« Reply #1 on: October 14, 2011, 05:50:44 AM »
In includes/functions.php find:
    "image_hits" => $image_row['image_hits'],

Insert below:
    "image_hits_day" => number_format($image_row['image_hits'] / ((time() - $image_row['image_date']) / 86400), 1"."""),


In details.html and/or thumbnail_bit.html use {image_hits_day}
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.805
  • I ♥ 4I
    • View Profile
Re: Bilder aufrufe / Image Views
« Reply #2 on: October 14, 2011, 10:49:56 AM »
Thx,

but i have a Problem!

All standard details like image_date {image_date}, {image_hits}, {image_keywords} and other information will not be displayed .... can someone help me? And {image_file_size} is showing up!?

--

Alle Standard angaben wie {image_date}, {image_hits}, {image_keywords} und die anderen Angaben, werden nicht angezeigt.... kann mir da jemand helfen? Und {image_file_size} wird aber angezeigt!?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Bilder aufrufe / Image Views
« Reply #3 on: October 14, 2011, 01:54:55 PM »
after this change or it was happening before?

Are you sure these tags are not between some conditional tags {if blah} ... {endif blah}?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.805
  • I ♥ 4I
    • View Profile
Re: Bilder aufrufe / Image Views
« Reply #4 on: October 15, 2011, 11:50:33 AM »
Hi Vano,

I can not say exactly. I have a few days ago started a new design to adapt. I started with the home.html. Now I'm in the details.html and since I first noticed this. I've made ​​no modifications to the details page.

I am now a bit stumped what is happening and where the error is. Open tags are also not available.

Rembrandt

  • Guest
Re: Bilder aufrufe / Image Views
« Reply #5 on: October 15, 2011, 03:39:20 PM »
funktioniert ganz mormal

mfg Andi

Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.289
    • View Profile
    • Discover the New World of Kindersurprise
Re: Bilder aufrufe / Image Views
« Reply #6 on: October 15, 2011, 04:05:12 PM »
funktioniert ganz mormal

mfg Andi

wie wird das denn ausgerechnet ?

hatte es auch eingebaut gehabt, auf einem Bild waren 2 Klicks, und wurde angeblich 62,2 x angesehen, kann doch nicht stimmen ? oder wie setzt sich das zusammen ?

LG

 
Danke Harald




Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.805
  • I ♥ 4I
    • View Profile
Re: Bilder aufrufe / Image Views
« Reply #7 on: October 15, 2011, 04:06:05 PM »
Ich habe generell das Problem das ich in der Detailsansicht keine Ausgabe wie {image_date}, {image_hits}, {image_keywords}, {image_hits} ausgeben lassen kann.

Ich musste schon einiges extra in die details.php schreiben

$site_template->register_vars(array(
  
"msg" => $msg,
  
"clickstream" => $clickstream,
  
"lang_category" => $lang['category'],
  
"lang_added_by" => $lang['added_by'],
  
"lang_description" => $lang['description'],
  
"lang_keywords" => $lang['keywords'],
  
"lang_date" => $lang['date'],
  
"image_date" => format_date($config['date_format']." ".$config['time_format'],$image_row['image_date'])." Uhr",
  
"image_description" => $description,
  
"image_hits_day" => number_format($image_row['image_hits'] / ((time() - $image_row['image_date']) / 86400), 1"."""),
  
"image_hits" => $image_row['image_hits'],
  
"lang_hits" => $lang['hits'],
  
"lang_downloads" => $lang['downloads'],
  
"lang_rating" => $lang['rating'],
  
"lang_votes" => $lang['votes'],
  
"lang_author" => $lang['author'],
  
"lang_comment" => $lang['comment'],
  
"lang_prev_image" => $lang['prev_image'],
  
"lang_next_image" => $lang['next_image'],
  
"lang_file_size" => $lang['file_size']
));


Jetzt kann ich image_description und image_date ausgeben, aber image_hits_day und auch nur image_hits funktioniert nicht!?
Ich finde einfach den Fehler nicht

Rembrandt

  • Guest
Re: Bilder aufrufe / Image Views
« Reply #8 on: October 15, 2011, 04:55:23 PM »
funktionieren tut es ja folgendermaßen.
in der details.php wird mittels:
show_image($image_row$mode01);
die funktion "show_image" in der functions.php aufgerufen und die darin enthaltenen definierten variablen zurück gegeben, unter anderen auch:
"image_hits_day" => number_format($image_row['image_hits'] / ((time() - $image_row['image_date']) / 86400), 1"."""),


mfg Andi

Offline tennis-ecards

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Bilder aufrufe / Image Views
« Reply #9 on: October 17, 2011, 04:18:21 PM »
Hi zusammen,

"Hits pro Tag" funktioniert super. Gibt es auch die Möglichkeit das so zu konstruieren, dass man

a) eine Top 10 erstellen kann (also wie bei Top 10 nach Anzahl Hits in diesem Fall eben Top 10 nach "Hits pro Tag")?
b) die Bilder in den Kategorien nach "Hits pro Tag" sortieren kann (so wie man es mit einem MOD auch für Anzahl Hits kann)?

Habe leider keine echte Kenntnis von Datenbanken und wahrscheinlich braucht man das hierfür, oder?

Danke vorab.