4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: Sunny C. on October 13, 2011, 11:01:25 PM

Title: Bilder aufrufe / Image Views
Post by: Sunny C. 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).
Title: Re: Bilder aufrufe / Image Views
Post by: V@no 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}
Title: Re: Bilder aufrufe / Image Views
Post by: Sunny C. 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!?
Title: Re: Bilder aufrufe / Image Views
Post by: V@no 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}?
Title: Re: Bilder aufrufe / Image Views
Post by: Sunny C. 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.
Title: Re: Bilder aufrufe / Image Views
Post by: Rembrandt on October 15, 2011, 03:39:20 PM
funktioniert ganz mormal

mfg Andi
Title: Re: Bilder aufrufe / Image Views
Post by: Jan-Lukas 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

 
Title: Re: Bilder aufrufe / Image Views
Post by: Sunny C. 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
Title: Re: Bilder aufrufe / Image Views
Post by: Rembrandt on October 15, 2011, 04:55:23 PM
funktionieren tut es ja folgendermaßen.
in der details.php wird mittels:
show_image($image_row, $mode, 0, 1);
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
Title: Re: Bilder aufrufe / Image Views
Post by: tennis-ecards 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.