PDA

View Full Version : my photoblog is divided into two(need suggestion)


jdleung
03-16-2007, 01:41 AM
I create another photoblog on my original site today. different photo size and style.

when you go the main www.jdleungs.com, it will first show you two links to choose. then you'll enter either the following

www.jdleungs.com/left
www.jdleungs.com/right

I wonder
if the visistor feels boring for such steps?
if all the orginal links broken on the search engine?

or you can give me better suggestion to run two photoblogs on one site. or any sample photoblog like this.

thanks.

austriaka
03-16-2007, 06:52 AM
Hm. I like the idea of changing styles.
But: I really miss a link to "left" and "right" when being in the other section.
It is a bit confusing, I don't think people will go visiting both blogs, just decide for one at the main page (by chance) and stay there.

An idea: I used klimin_a_s' "Custom fields addon" (http://forum.pixelpost.org/showthread.php?t=5780) for changing the style depending on the value of a custom field in the photoblog of my children (http://forum.pixelpost.org/showthread.php?t=5996).
Have a live view here: http://kg3.de/kinder

Just the style sheet is changing depending on photographer between "girl" and "boy". But with a little hacking it should be possible to change the template as well. Then you will have only one blog and design is changing depending on photo.

Just an idea...
KArin

jdleung
03-16-2007, 09:54 AM
That's amazing! KArin
I had downloaded the addon, how to hack pixelpost?

thanks.

austriaka
03-16-2007, 02:25 PM
open admin_customfields.php
goto line 627
insert after:

if ($cf_value=='LEFT_BLOG'){
$tpl = str_replace("<STYLESHEET>",'<link rel="stylesheet" type="text/css" href="PATH_TO_STYLESHEET_FOR_LEFT_BLOG" title="left" />',$tpl);
elseif ($cf_value=='RIGHT_BLOG'){
$tpl = str_replace("<STYLESHEET>",'<link rel="stylesheet" type="text/css" href="PATH_TO_STYLESHEET_FOR_RIGHT_BLOG" title="right" />',$tpl);
else {
$tpl = str_replace("<STYLESHEET>",'<link rel="stylesheet" type="text/css" href="PATH_TO_DEFAULT_STYLESHEET" title="default" />',$tpl);

save admin_customfields.php

open image_template.html
look for the stylesheet definition in <head> section
<link rel="stylesheet" type="text/css" href="templates/... />
<link rel="alternate stylesheet" type="text/css" href="templates/...
replace all of them with new tag <STYLESHEET>
save image_template.html

use:
Use only one custom field!
Insert your identifier for [LEFT_BLOG] and [RIGHT_BLOG] as value for the custom field (use this identifier in the code at admin_customfields.php, logo ;-))
If you did all right it should work now.

Be aware, with this example you have only one image_template for both, all changes are made with the css!

If you want to use different image_templates as well, you have to hack it in the index.php in line 258:

$query = "SELECT a.name, b.value FROM ".$pixelpost_db_prefix."customfields AS a, ".$pixelpost_db_prefix."customfieldsvalues AS b WHERE b.customfield_id = a.id AND b.parent_id=$image_id AND a.enable='on' AND a.visible='on' order by a.fieldorder";
$result = mysql_query($query) or die("Invalid query (2): " . mysql_error());
while(list($cf_name, $cf_value) = mysql_fetch_row($result))
{
$cf_value = pullout($cf_value);
if ($cf_value == "LEFT_BLOG"){ $tpl = file_get_contents("templates/".$cfgrow['template']."/img_left_template.html");
}
elseif ($cf_value == "RIGHT_BLOG"){ $tpl = file_get_contents("templates/".$cfgrow['template']."/img_right_template.html");
}
else { $tpl = file_get_contents("templates/".$cfgrow['template']."/img_template.html");
}

(not tested)

If you want to use more than one custom field, you have to change the hack in admin_customfields.php for asking name and value, not only value. But that you will find out yourself ;-)

HTH
KArin

jdleung
03-16-2007, 03:00 PM
thank you, KArin.
I do need two image_template.html, I'm trying....

jdleung
03-17-2007, 05:27 AM
KArin, I finally use another way to do that.
I use GeoS category addon, and hack index.php

//jdleung style switch
if($_GET["category"]==2) { $cfgrow['template'] = "dream"; }
//end style switch

need to do: get calendar and month calendar work with GeoS category addon.

and one thing I don't understand
on my pc, when click to the second section, it shows the last uploaded image first(no matter what category). but it works fine on the server.

austriaka
03-17-2007, 09:59 AM
//jdleung style switch
if($_GET["category"]==2) { $cfgrow['template'] = "dream"; }
//end style switch
Ah, using the cfgrow value is a cool idea, it gives you much more flexibility!
need to do: get calendar and month calendar work with GeoS category addon.
I made that with calendar addon for my blog because I did something similar: I changed the default category to show up from "ALL" to "DIGEST".
I defined "ALL" as a real category and force PP to show DIGEST if none is selected.
And I wanted people staying within their actual category until they explicitely change that.

To make the calendar thing work with the hacked category addon you have to insert "&category=$_GET['category']" resp. the "&category=$category" into every image link they produce.
If you want I can send you my hacked calendar per email (contact me at 2§kg3.de). But it is not so complicated though.
I didn't do it for the month calendar, because I treet the months in monthly calendar as own categories in browse template. It shows up category "all" and stays there when returning to image page. I don't remember if I had to change something in month calendar for that, I don't think so.

and one thing I don't understand
on my pc, when click to the second section, it shows the last uploaded image first(no matter what category). but it works fine on the server.
I don't know where this effect comes from, compare the phpinfo() of local and server? Do you have a .htaccess on the server?
I have a similar effect in my image stats addon: if my home page is called (http://blog.uhlig.at, without an image and a category, what should immedeatly lead to DIGEST) and there is a newer image in another cat than "DIGEST", it counts both, the one in the "wrong" category and the one in DIGEST. It works correct on local but not on server. (I had to hack my own addon for that ;-))

LG
KArin

jdleung
03-17-2007, 12:17 PM
thanks ,KArin. I had hacked the calendar addon before, and the month calendar addon is written by me. (view my signature)

I also force GeoS category addon to read a specified category when load the main page.

beside the problems above on the last post, I can't make the thumbnails archive page works.

http://www.jdleungs.com/index.php?x=browse&pagenum=1&style=2

when click the month name at the bottom, it works just because I delete the category id in url. dispaly too more thumbnails or none. 2 thumbnails is correct.
http://www.jdleungs.com/index.php?x=browse&curr_year=2007&archivedate=2007-03&monthname=2007-03&pagenum=1&style=2&category=

when you add the "1" after it, it refuse to work.
http://www.jdleungs.com/index.php?x=browse&curr_year=2007&archivedate=2007-03&monthname=2007-03&pagenum=1&style=2&category=1

GeoS category addon can't work if there is no category id.

by now, I have to delete it to make it works temporerly.
BTW, all works well except thumbnail archive.

austriaka
03-18-2007, 12:49 PM
Hm, I really don't understand what is happening here.
When clicking into the Archive of category 2 I get only the list of months, no images at all.
When calling your march archive with the category empty, it shows 2 images right.
Whan calling january in that page, it shows the same weird page as in the link with category=1.

I remember I had similar troubles with the month calendar when installing it in my blog. This was the reason why I gave it up at last finding monthly categories in browse page. So one month is treated like an own category for me, showing all images in month. I didn't change _your_ ;-) month calendar addon at all.
You do not want to show both blogs in one Archive, is that right?

Hm. Yet another idea:
Forget it about categories. Try once again Andrews custom fields addon for that.
Change the thumb display and the month calendar to look for that field value in database and let it only show these images. So you only need the get style=1 or style=2 in the link and don't have to change the category label.
Instead of
if($_GET["category"]==2) { $cfgrow['template'] = "dream"; }
use
if($_GET["style"]==2) { $cfgrow['template'] = "dream"; }

KArin

jdleung
03-18-2007, 02:23 PM
I may found the key.
this is maybe the reason of page archive addon, since this addon use "archivedate", "monthname" and "curr_year" as date archive, and use "category" as category archive.

when I try to put them together in url and prees enter, there will be problem.

go to your site's archive page->select Mar,2006, there is only one images. add &category=1 at the end of the url, press enter. then many images will come out.

this happen even they use no month calendar!

so I had hide the thumbnail archive temporarily, and use my text archive addon. this addon use iptc info. I always input image name and description in iptc. because less people use iptc, so I have not release it.

and now I use exif(image width) to automatically select template.

jdleung
03-19-2007, 05:48 AM
the thumbnails archive works again now.
http://www.jdleungs.com/index.php?x=browse&pagenum=1&category=1

the page_archive addon have to be modified so that it works.