Filedownloadcount-Quick-Code-Snipped

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
Post Reply
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Filedownloadcount-Quick-Code-Snipped

Post by marcus@localhorst »

Maybe you've noticed, that the Database Table phpwcms_file contains two rows called f_dlstart and f_dlfinal which counts the downloads of your non picture files (exe,zip,mp3,mpg,avi). Edit: from your -file download contentpart-!
Because I'm to lazy to use a third party dlcounter-hack I've just copy&paste some phpwcms codeparts, to display the counted files inside filecenter. (Under each option of filecenter! ;-))

open include/inc_tmpl/files.abschluss.tmpl.php
and add the following snipped at the end of file:

Code: Select all

<?php
$file_sql = "SELECT * FROM ".DB_PREPEND."phpwcms_file WHERE  f_trash=0 AND f_dlstart > 0 OR f_dlfinal > 0 ORDER BY f_dlfinal DESC;";

echo "<ul>";
if($file_result = mysql_query($file_sql, $db) or die ("error while listing files")) {
	while($file_row = mysql_fetch_array($file_result)) {
		$filename = html_specialchars($file_row["f_name"]);
		echo "<li><b>".$filename. "</b><br />start: " . $file_row["f_dlstart"]. "| final: " . $file_row["f_dlfinal"]."</li>";
		}
}
echo "</ul>";
?>
PLEASE NOTICE! this is just a hint for people who like to tweak their system, to learn more. This is not a stable or a suggested solution from the phpwcms developer (I think he would not like that ;-)).
Please do not ask for support. Thanks, m.
Last edited by marcus@localhorst on Wed 17. Jan 2007, 18:34, edited 2 times in total.
User avatar
Oliver Georgi
Site Admin
Posts: 9892
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

every file downloaded via files content part will be tracked.

OLiver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Post by marcus@localhorst »

ok, thanks, I've doesn't noticed that, because I provide only mp3 files and these are counted, it seems I misunderstood the function which track the started and full downloads. I'm a bit lazy at the moment . :oops:
User avatar
StudioZ
Posts: 802
Joined: Fri 28. May 2004, 19:57
Location: Québec, Canada
Contact:

Post by StudioZ »

Oliver Georgi wrote:every file downloaded via files content part will be tracked.

OLiver
I would also add this great new improvement that I noticed in pre1.2.9:
"every file downloaded via files content part" is now indexed in the Search

So... if you have a public file named mynewfiletodownload.pdf
and you enter mynew ... the Search will find it. Isn't it great ? 8)
Yeah ! :D :D :D

Awesome :wink:

Seriously... the only real thing missing to this great and awesome CMS is now.. the espresso machine and the long awaited User management :wink:

Yves
Image
PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!
phalancs
Posts: 793
Joined: Thu 19. Feb 2004, 05:09
Location: Germany

Post by phalancs »

this is nice, did not think thta it would be so simple to get the filecounts. Ok but I want the numbers to be displayed next to the file names.
Any Idea where to search?
2008
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Post by marcus@localhorst »

phalancs wrote:this is nice, did not think thta it would be so simple to get the filecounts. Ok but I want the numbers to be displayed next to the file names.
Any Idea where to search?
take a look first into phpwcms.php and searching for

Code: Select all

case: "files"
there you will find all used/included files for the filecenter, or check include/inc_tmpl and include/inc_lib for all files with suffix files.blabla.php
it's a bit difficult to find the right one :-)
the rest should be easy

best marcus
User avatar
StudioZ
Posts: 802
Joined: Fri 28. May 2004, 19:57
Location: Québec, Canada
Contact:

Post by StudioZ »

phalancs wrote:this is nice, did not think thta it would be so simple to get the filecounts. Ok but I want the numbers to be displayed next to the file names.
Any Idea where to search?
Hi Phalancs,
I just upgraded my site to 1.2.9 and if you visit this page:
http://www.malouin.ws/design/index.php? ... ds-phpwcms

Here is the default template I modified a bit to present the files:

Code: Select all

<!--FILE_SETTINGS_START//-->
; this is formatted like WIN.INI
; please: do not use comments for value lines
icon_path 		= "img/icons/"
icon_name 		= "small_icon_{FILE_EXT}.gif"
file_size_round	= 1
date_format		= "%Y/%m/%d"
; set_locale		= "de_DE@Euro"
set_locale		= "fr_CA"
<!--FILE_SETTINGS_END//-->

<div style="margin-top: 0px; padding-top: 0px; border-top: 0px dotted #CCCCCC;">
<!--FILE_ENTRY_START//-->
	<div class="fileEntry" style="margin-bottom:10px; padding-bottom: 10px; border-bottom: 0px dotted #CCCCCC;">
			[FILE_IMAGE_ELSE]<img src="{FILE_ICON}" alt="" border="0" />[/FILE_IMAGE_ELSE]
			[FILE_IMAGE]<img src="{FILE_IMAGE}" alt="" border="" />[/FILE_IMAGE]
			<a href="{FILE_LINK}"{FILE_TARGET}>[FILE_TITLE]{FILE_TITLE}[/FILE_TITLE][FILE_TITLE_ELSE]{FILE_NAME}[/FILE_TITLE_ELSE]</a>
		<br />[FILE_DESCRIPTION]
		{FILE_DESCRIPTION}<br />[/FILE_DESCRIPTION]
		File updated: {FILE_DATE} | Size: {FILE_SIZE}<br /> 
		Downloads: {FILE_DOWNLOADS}
		<br />
	</div>
<!--FILE_ENTRY_END//-->
</div>
and now... to have the numbers to be displayed next to the file names, I would modify the template like this (see: {FILE_DOWNLOADS} portion):

Code: Select all

<!--FILE_ENTRY_START//-->
	<div class="fileEntry" style="margin-bottom:10px; padding-bottom: 10px; border-bottom: 0px dotted #CCCCCC;">
			[FILE_IMAGE_ELSE]<img src="{FILE_ICON}" alt="" border="0" />[/FILE_IMAGE_ELSE]
			[FILE_IMAGE]<img src="{FILE_IMAGE}" alt="" border="" />[/FILE_IMAGE]
			<a href="{FILE_LINK}"{FILE_TARGET}>[FILE_TITLE]{FILE_TITLE}[/FILE_TITLE][FILE_TITLE_ELSE]{FILE_NAME}[/FILE_TITLE_ELSE]</a>&nbsp;Downloads:&nbsp;{FILE_DOWNLOADS}  
		<br />[FILE_DESCRIPTION]
		{FILE_DESCRIPTION}<br />[/FILE_DESCRIPTION]
		File updated: {FILE_DATE} | Size: {FILE_SIZE}
		<br />
	</div>
<!--FILE_ENTRY_END//-->
</div>
Cheers,

Yves
Image
PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Post by marcus@localhorst »

just want to say, my hack is for the backend!
Yves means the frontend, if I'm right?!
User avatar
StudioZ
Posts: 802
Joined: Fri 28. May 2004, 19:57
Location: Québec, Canada
Contact:

Post by StudioZ »

marcus@localhorst wrote:just want to say, my hack is for the backend!
Yves means the frontend, if I'm right?!
Yes. You are right marcus :wink:
I guess my reflexes brings me to be just more of a frontend guy
than a backend guy :wink: I always hate to have to hack. :wink:
Could be my age ? :wink:

Cheers,

Yves
Image
PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!
phalancs
Posts: 793
Joined: Thu 19. Feb 2004, 05:09
Location: Germany

wow

Post by phalancs »

Hey Yves!
Wow, this is great, exactly what i have thought about, thanx a lot for sharing :)

Will try it as soon as possible!

BTW: what kind of DHTML menu are you using :O
2008
User avatar
StudioZ
Posts: 802
Joined: Fri 28. May 2004, 19:57
Location: Québec, Canada
Contact:

Re: wow

Post by StudioZ »

phalancs wrote:... BTW: what kind of DHTML menu are you using :O
Hi Phalancs :wink:
I am using a commercial feature,
introduced and supported by Oliver since 1.2.8:
deluxe-menu

You will find all the details at: http://www.deluxe-menu.com

If you search the forums for "deluxe-menu"
you will tips and tricks to get it started pretty fast.

Cheers,

Yves
Image
PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!
FKU
Posts: 7
Joined: Tue 27. Dec 2005, 20:21

Deluxe_menu - Settings

Post by FKU »

I'am also using the commercial script deluxe-menu for this site:

http://www.amerika-holzer.at/a/index.ph ... ,0,0,1,0,0 - (Not finished yet - beta stadium)

It is possible that for example only the last point of of each menu strukture is clickable?

At the moment you can click at every element in the menu-structure! That causes a lot of work - (articlelist pages).

For example:

Hotel (dropdown - no article content is shown)
Willkommen (clickable - article content)
Übersicht (clickable - article content)
Bilder (clickable - article content)
Kulinarik (dropdown - no article content is shown)
Über uns (clickable - article content)

Thanks Florian
User avatar
StudioZ
Posts: 802
Joined: Fri 28. May 2004, 19:57
Location: Québec, Canada
Contact:

Post by StudioZ »

Hello Florian,

If I well understand your needs then...
I would suggest you edit each Category per your needs
for those you don't want to appear in the menu,
by ticking the "hide" option in the "frontend menu status:"

Something else you might consider is...
using the powerfull redirects options (see: "redirect to:")
and this, available both at Article and Category level.

Cheers,

Yves
Image
PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!
Post Reply