View Full Version : Meta Categories Browser
se.nsuo.us
01-07-2006, 09:52 AM
NOTE: Tested with Pixelpost 1.5 Beta only may not work with 1.4x
What is this?!
I like to see data/pictures from my pixelpost in a variety of ways, this addon makes it easy for anyone to do so.. More specifically this addon displays thumbnails for meta categories like Most Commented, Last Commented, Most Viewed, Last Viewed and Categories as Tag Cloud. Number of thumbnails can be controlled by setting limit_images in the addon file, defaults to 25.
Usage
Unzip, if you are reading this you know how
Put meta_categories.php in the addons directory
Put meta_template.html in the templates/simple directory
Ensure that the template for your Pixel Post is set to *simple* and browse to the URL of your Pixel Post
http://site.com/photoblog/index.php?x=meta&z=lastcomm
Note the URL part after "?" This should show you the last 25 comments in your photoblog (All common sense caveats apply)
Whats with meta_template.html?
This is a custom template to display the contents of Meta Categories it has two special tags
<META_TITLE> This is replaced by the relevant text like Most Commented pictures etc
<META_CONTENT> This is where the thumbnails/content is put
You can very easily modify browse_template.html of any theme to meta_template.html by removing the browse specific tags and putting the above two.
See the supplied template as an example, rest is upto you :)
What are the other tags special to Meta Categories Addon?
<META_MOSTCOMMENTED_LINK> URL to page with most commented pictures
<META_LASTCOMMENTED_LINK> URL to page with last commented pictures
<META_MOSTVIEWED_LINK> URL to page with most viewed pictures
<META_LASTVIEWED_LINK> URL to page with last viewed pictures
<META_TAGCLOUD_LINK> URL to page with categories shown as a tag cloud
<META_ALL_LINKS> Complete links to all meta categories shown as HTML list
It is suggested that you put <META_ALL_LINKS> somewhere in your browse_template.html
Who is responsible for this code?
I built upon the code of already existing addons see the addon file for acknowledgement, to contact me, mail me at photographer@se.nsuo.us
To Do
For now nothing but I may consider feature request if they are kewl enough
Download
http://se.nsuo.us/contrib/meta_categories.zip
Demo
http://se.nsuo.us/index.php?x=meta&z=mostcomm (May not be work safe for some)
P.S. If someone uses it please post a work safe URL in reply - thanks
Joe[y]
01-07-2006, 10:14 AM
good work. i don't have much use for it right now but very well done. can i just ask why the template file has to go in the simple template folder?
se.nsuo.us
01-07-2006, 10:23 AM
Thanks
']why the template file has to go in the simple template folder?
Because it is for simple theme.
If you make one for theme XYZ then it will go in the XYZ template folder
Since 1.5 is shipping with just Simple I made a sample for simple :)
Joe[y]
01-07-2006, 11:04 AM
Thanks
Because it is for simple theme.
If you make one for theme XYZ then it will go in the XYZ template folder
Since 1.5 is shipping with just Simple I made a sample for simple :)
fair dinkum!
blinking8s
02-10-2006, 10:02 AM
very very cool addon, i have trouble keeping up with all that goes on since i have been travelling so much and busy with school...nice work indeed. Already have something I might need to try it out for...
se.nsuo.us
02-10-2006, 10:48 AM
Glad you like it :) - if you set it up, please post a work safe URL for (more) people to see
ego-s
03-01-2006, 01:30 PM
For my site, "last viewed", "most viewed" and "tag cloud" don't seem to work properly, as they don't return any result.
I'm just testing the plugin and haven't adapted the css yet ( http://www.ego-s.net/pixel/index.php?x=meta&z=mostviewed )
se.nsuo.us
03-02-2006, 03:39 AM
Does your database has a table called something similar to _views? This table is needed can automatically created.
Also which version of MySQL are you running? tagcloud will not return anything if the your MySQL cannot run that query.
Try commenting out the line error_reporting(0); in index.php and let me know all the errors that are shown.
ego-s
03-02-2006, 11:47 AM
i have a table called _visitors in my database, which contains keys like datetime, ip, referer ... so this should be it ? ... or not ? :confused:
db version is 3.23.58, is a higher version needed? ( as i could switch to 4.1.14)
turning error reporting on leads to two messages concerning the admin ping plugin.
:wink:
se.nsuo.us
03-02-2006, 01:42 PM
Did you not get any other error when you tried to go to the last viewed etc?
BTW - I will be out of town till Monday - so post whatever additional info you can - I will come back and take a look...
ego-s
03-02-2006, 01:53 PM
I totally missed the part where it says : not only open index.php after switching on error reporting but also test the category plugin :rolleyes: ( ... i'm a noob, i know :D )
error for most and last : Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /mywebsite/../meta_categories.php on line 120
errors for clouds : Warning: Wrong parameter count for max() in /mywebsite/../meta_categories.php on line 174
Warning: Wrong parameter count for min() in /mywebsite/../meta_categories.php on line 174
Warning: Invalid argument supplied for foreach() in /mywebsite/../meta_categories.php on line 179
thx in advance :)
ego-s
03-09-2006, 10:02 AM
Any clues so far? I'd love this plug to run.
Do you think it depends on the sql version?
se.nsuo.us
03-09-2006, 10:07 AM
Oops! forgot about this - sorry - yes looks like your MySQL is not supporting the REPLACE INTO query to be exact
$query = "REPLACE INTO {$pixelpost_db_prefix}views(parent_id,ip,this_mont h) VALUES ('$image_id', '{$_SERVER['REMOTE_ADDR']}',$this_month)";
This query is not getting executed - can you have your MySQL upgraded and try again?
ego-s
03-09-2006, 10:44 AM
it's working :)
I didn't want to upgrade at first, because I cannot go back to the previous version (without reinstalling) ... so, you know this "never change a running ..."
but hey ... it's working :)
thx!
iphimeda
03-10-2006, 08:42 AM
Nice. I like the idea. Going to test it on my photoblog next week. =)
hey i'm having same problem as ego, what do you mean by upgrading mysql??
ego-s
05-01-2006, 11:28 PM
I was able to upgrade the mysql-Version in use by my Pixelpost installation via the admin interface of my webspace. I changed from 3.23.58 to 4.1.14 and it's working now ( http://ego-s.net/pixel/index.php?x=meta&z=lastviewed ).
So it all depends on your hoster :)
my db currently runs on 4.0.24 and i can't upgrade it :( so this means i can not use the meta tags "last viewed" & "most viewed"?
In MySQL manual there is info that REPLACE statement can be replaced with INSERT ... ON DUPLICATE KEY UPDATE which is available as of MySQL 4.1.0 :/
http://dev.mysql.com/doc/refman/4.1/en/replace.html
Thanks for the link GeoS, i looked on it, but i simply can't find out what exactly to do, is there any chance you could like "cut it out" for me.? hehe
Cosmo
06-15-2006, 07:53 PM
Same prob here, MySQL 4.0.24 and I also don't see "last viewed" & "most viewed".
Any solutions?
mauritz
07-28-2006, 02:22 PM
<META_MOSTCOMMENTED_LINK>
<META_LASTCOMMENTED_LINK>
<META_MOSTVIEWED_LINK>
<META_LASTVIEWED_LINK>
I'm using these now, but I want them in a drop down box. Like my other category's. Anyone knows how to fix that?
DikkieBurger
07-28-2006, 07:15 PM
I think like this:
<form action="./" method="GET">
<select name="meta">
<option>
<a href="www.yourdomain.com/<META_MOSTCOMMENTED_LINK" />
</option>
<option>
<a href="www.yourdomain.com/<META_LASTCOMMENTED_LINK" />
</option>
<option>
<a href="www.yourdomain.com/<META_MOSTVIEWED_LINK" />
</option>
<option>
<a href="www.yourdomain.com/<META_LASTVIEWED_LINK "/>
</option>
</select>
</form>
BTW this addon works with 1.5 FINAL.
se.nsuo.us
07-29-2006, 04:06 AM
@DikkieBurger - thanks for the code and feedback - most of my addons *should* work with 1.5 Final
SnowScan
07-29-2006, 10:15 AM
cool addon - it is implemented here: http://www.snowscan.org/index.php?x=about
Thanks for the nice work and sharing it :)
Regards,
Peter Hestbaek
www.snowscan.org
lowlander
11-03-2006, 10:21 AM
Thanks for the add-on, I use it here:
http://exposedplanet.com/index.php?x=browse&z=tagcloud (SFW)
One problem though: the most viewed pictures link also shows images that are 'posted in the future', i.e. thumbs of pix that should not be shown yet.
The link do not work, but the thums do show, while they do not show at the 'All images' link (as it should be.)
Can this be altered?
Thanks,
LL
Dennis
11-03-2006, 04:17 PM
Lowlander, this could be done by changing the MySQL statement somewhere so pictures with a certain posting date will not be selected.
stevendavid
08-04-2007, 11:03 PM
Hey guys... I really suck at programming, so I hope one of you can help me.
I'm running PP 1.6.0 and I can't manage to get
most viewed, last viewed, and tag cloud to work properly with the meta categories addon. I
essentially am seeking to get only a tag cloud for my browse template.
Strangely though, the other two are fine (Most commented/last
commented), which leads me to believe I installed it properly. Do you
have any idea what I could do to fix this? Also, I can't
get warchive.php to work either. Maybe I need to upgrade MySQL. This
is a link to the meta template on my site:
http://stevendavid.eu/index.php?x=meta&z=lastcomm If you could help me
out, I would really appreciate it!
PHP-version 4.3.11 (Pixelpost's min requirement: PHP version: 4.3.0 )
Session save path /tmp
MySQL version 4.0.27-max-log (Pixelpost's min requirement: MySQL: 3.23.58 )
GD-lib bundled (2.0.28 compatible) with JPEG support
File Uploads to Pixelpost site are possible.
Server Software Apache
tomms
06-19-2008, 04:00 AM
im running 1.7 but i cant seen to get last viewed/most viewd to work
also, is there any upgrade on the addon?
Omar1000
01-05-2009, 06:05 PM
One problem though: the most viewed pictures link also shows images that are 'posted in the future', i.e. thumbs of pix that should not be shown yet.
The link do not work, but the thums do show, while they do not show at the 'All images' link (as it should be.)
Can this be altered?
I just started to use this addon, truly nice one, but I have the same problem like lowlander. I am not fit in php, does anybody have a solution?
Lowlander, did you solve this problem?
Omar1000
01-07-2009, 02:38 PM
Solved!
I got it, just add in line 140 "where b.datetime<='$cdate'"
and the posted pictures in future will not be shown
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.