Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Hacks and Modifications

Post Reply
 
Thread Tools
  #1  
Old 08-16-2006, 01:56 PM
k3v Offline
forum loafer
 
Join Date: Aug 2006
Location: Toronto
Posts: 13
Group + Personal Photoblog

I installed pixelpost as a group photoblog. I know it doesn't yet have this functionality, but I hacked it a bit to make it behave better for a group photoblog.

Actually, to be precise, we're simply sharing one admin account to post photos, but what I wanted it to do was to have a separate "photoblog" view (i.e. not a browse view) for only my photos. Same for all the other contributers to the photoblog.

How our group photoblog works is that whenever a group member posts, we add a specific category to that photo (in addition to any other ones), so when I post I make sure all my photos are tagged with #k3v.

Then I changed the index.php to accept another parameter which lets me specify which category I only want to view. It works based on the ID of the category (may have to dig in the database to find this). In my case, my #k3v category is category ID 1 so when I go to http://HotPhotatoes.photoquickies.com/?browseCat=1 it will load up only my photos. I've attached my modified index.php below, you can see which sections I modified by searching for "k3v mod".

What I've changed:
  • Only show photos from 1 category in photoblog view
  • Navigate (previous, next) within category
  • Browse defaults to currently viewing category
  • Custom title for each category (this requires a bit of hacking on your part)

What I haven't changed
  • Default Home link and link from Site title. These will send you back to the original category-less page. If you want to change this, you need to edit your template.
  • Only works for sites without MOD_Rewrite enabled (I'm on Dreamhost, so I configured for that). You can fix this by looking at where $showlink is first defined
  • Probably more, can't remember right now.

How do you attach files on this forum? I can't find it in the post options. Anyways, you can download it from my server for now
__________________
I'm part of a group Photoblog from Toronto, Canada called HotPhotatos.

Group Photoblog: http://HotPhotatoes.photoquickies.com/
Only My Photos: http://HotPhotatoes.photoquickies.com/k3v
Reply With Quote
  #2  
Old 08-16-2006, 03:01 PM
Connie
Guest
 
Posts: n/a
Please be aware that we do not recommend to hack core files at all
will you support the users who upgrade and run into problems?

why don't you write Addons???Admin-Addon??

I think you have the skill for that (and we won't have the trouble later.. when you not standing by giving support!)

please do not propagate index-hacks.
Reply With Quote
  #3  
Old 08-16-2006, 03:07 PM
GeoS's Avatar
GeoS+ Offline
Team Pixelpost
 
Join Date: Apr 2005
Location: Warsaw, Poland
Posts: 3,613
Send a message via ICQ to GeoS Send a message via Skype™ to GeoS
Connie, take it easy :P

As he want to release hack then he is doing it. Just for that is this section of forum.

Other thing is that we (dev team) wont support hacked core files as we cant trace all changes which are making users. All problems should go to authors of hacks.

The best, fastest and easiest way of doing such stuff are addons which right now are very powerful. They save core files untouched and in every moment there is option of switching off addon or easy replacing it with newer version.
__________________
photoblog | portfolio | addons | Donate
Reply With Quote
  #4  
Old 08-16-2006, 03:24 PM
k3v Offline
forum loafer
 
Join Date: Aug 2006
Location: Toronto
Posts: 13
True, I should have looked at making it an addon. I just took a brief look at the Addon structure, and it should be not too bad; although I would have to duplicate a lot of code from the core files (i.e. the navigation queries and variables), so if they are changed in subsequent releases, things would be broken anyways.

Maybe the dev team can include this functionality in the core for the next release
__________________
I'm part of a group Photoblog from Toronto, Canada called HotPhotatos.

Group Photoblog: http://HotPhotatoes.photoquickies.com/
Only My Photos: http://HotPhotatoes.photoquickies.com/k3v
Reply With Quote
  #5  
Old 08-16-2006, 03:44 PM
k3v Offline
forum loafer
 
Join Date: Aug 2006
Location: Toronto
Posts: 13
Actually, I started rewriting my hack as an addon, but I don't think it's a good idea, because I end up duplicating the entire code that loads an image (since the core files queries for a photo and populates everything, then at the end addons are called and I have to re-query based on the category and populate everything again).

What would be nice from an architectural view of the application is if there are a variety of hooks for the addons. For example it would help me if there was an addon hook right after the photo query, but before the variables are populated. I'm sure there are a lot of other places where addon hooks will be useful, but it is a lot of complexity...
__________________
I'm part of a group Photoblog from Toronto, Canada called HotPhotatos.

Group Photoblog: http://HotPhotatoes.photoquickies.com/
Only My Photos: http://HotPhotatoes.photoquickies.com/k3v
Reply With Quote
  #6  
Old 08-16-2006, 06:18 PM
GeoS's Avatar
GeoS+ Offline
Team Pixelpost
 
Join Date: Apr 2005
Location: Warsaw, Poland
Posts: 3,613
Send a message via ICQ to GeoS Send a message via Skype™ to GeoS
Workspaces in frontend are planed in future versions.
You can use results of executed querys also in your own if other addons didnt touch its results.
My addon called GeoS Show Category has got some similar features as yours. You can look on it how it is build.
__________________
photoblog | portfolio | addons | Donate
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 01:28 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs