boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

/archives/p/X instead of /?p=X (experimental)
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    boardom Forum Index -> How to ?
View previous topic :: View next topic  
Author Message
sidcarter



Joined: 18 Sep 2002
Posts: 8

PostPosted: Sun Oct 13, 2002 12:31 pm    Post subject: b2calendar Reply with quote

This "feature" does not seem to work with b2calendar.php yet.
I am using v0.6

With b2calender, I still get ?m= type links for any calendar entry. Is this fixed in cvs ?

Thanks
Back to top
View user's profile Send private message Visit poster's website
Edlef



Joined: 16 Mar 2002
Posts: 71

PostPosted: Sun Oct 27, 2002 9:09 am    Post subject: ?m in calender Reply with quote

I have the same "problem", but it doesnt matter for me.
I have this thing working, everything seems ok.
Nice work!! Very Happy
Back to top
View user's profile Send private message Visit poster's website
imeridian



Joined: 12 Feb 2002
Posts: 191

PostPosted: Tue Oct 29, 2002 1:47 pm    Post subject: Reply with quote

The comments notification email and the calendar have been fixed in CVS to support the querystring options.

Update:

To have your (more...) link to show the $blogfilename instead of index.php you need to change your the_content() function to the_content('more','1','archives')

Heh, I thought it was a problem with b2template.functions.php but it really wasn't... I forgot about the built-in customization.
_________________
-indi<br>
http://indiboi.com
http://artlikepornstars.com
http://www.positivefusion.com
Back to top
View user's profile Send private message Visit poster's website
hawkin



Joined: 18 May 2002
Posts: 11

PostPosted: Tue Nov 05, 2002 5:36 am    Post subject: Reply with quote

is it possible to: instead of referring to the category id number, referring to the true category name?

Like: /archives/cat/Design
instead of: /archives/cat/6

It shouldn't be more than get the archive file to do a mysql query to the db, and figure out if the category specified really exists, and then change variables accordingly.

But I'm no master of preg_matches, so I can't come up with a clever idea of solsving this in code.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
imeridian



Joined: 12 Feb 2002
Posts: 191

PostPosted: Tue Nov 05, 2002 5:51 am    Post subject: Reply with quote

Actually, I think Michel and I discussed that... not sure if any more thought went into it though. It would be nice.
_________________
-indi<br>
http://indiboi.com
http://artlikepornstars.com
http://www.positivefusion.com
Back to top
View user's profile Send private message Visit poster's website
mikelittle



Joined: 11 May 2002
Posts: 376
Location: UK

PostPosted: Tue Nov 12, 2002 12:25 am    Post subject: Reply with quote

Folks,

I finally got round to implementing this feature. Inspired by a couple of
comments, I've taken it a little further.

I've added the category names to the category links so they now look like this:
http://zed1.com/b2/archives/cat/5/Geek_Stuff

I've added the month and year to the archive and calendar next/prev month links:
http://zed1.com/b2/archives/m/200211/November-2002

And I've added the post title to the permalinks:
http://zed1.com/b2/archives/p/475/more/1/c/1/More_about_Saturday

I'm not sure this is the most elegant way to do this, but it gets the words into the URLs for all those web crawlers out there. It works because blog.header.php stops parsing after it has found all the parameters it needs.

Diffs:

First for the archive links, (I've only done the months, I'm not sure how
valuable it would be for the weeks or days mode)
in b2archives.php round about line 62:
Code:
echo "<a href=\"$archive_link_m$arc_year".zeroise($arc_month,2).'">';

becomes
Code:
echo "<a href=\"$archive_link_m$arc_year".zeroise($arc_month,2).$querystring_separator.$month[zeroise($arc_month,2)].'-'.$arc_year.'">';



in b2calendar.php line 66:
Code:
$ak_previous_month_active = '<a href="'.$archive_link_m.$thisyear.$ak_previous_month.'" style="text-decoration: none;"><</a>  ';

becomes
Code:
$ak_previous_month_active = '<a href="'.$archive_link_m.$thisyear.$ak_previous_month.$querystring_separator.$month[zeroise($ak_previous_month,2)].'-'.$thisyear.'" style="text-decoration: none;"><</a>  ';

then on line 68:
Code:
$ak_next_month_active = '  <a href="'.$archive_link_m.$thisyear.$ak_next_month.'" style="text-decoration: none;">></a>';

becomes
Code:
$ak_next_month_active = '  <a href="'.$archive_link_m.$thisyear.$ak_next_month.$querystring_separator.$month[zeroise($ak_next_month,2)].'-'.$thisyear.'" style="text-decoration: none;">></a>';


In b2template.functions.php, the category link in list_cats() round about line 711 (in my modded version)
Code:
echo "\t<a href=\"".$file.$querystring_start.'cat'.$querystring_equal.$row->cat_ID.'">';

becomes
Code:
$cat_name2 = preg_replace('/[^a-zA-Z0-9_\.-]/', '_', $cat_name);
echo "\t<a href=\"".$file.$querystring_start.'cat'.$querystring_equal.$row->cat_ID.$querystring_separator.$cat_name2.'">';


and in the same file permalink_single() round about line 1098
Code:
echo $file.$querystring_start.'p'.$querystring_equal.$id.$querystring_separator.'more'.$querystring_equal.'1'.$querystring_separator.'c'.$querystring_equal.'1';

becomes
Code:
$title = preg_replace('/[^a-zA-Z0-9_\.-]/', '_', $postdata['Title']);
echo $file.$querystring_start.'p'.$querystring_equal.$id.$querystring_separator.'more'.$querystring_equal.'1'.$querystring_separator.'c'.$querystring_equal.'1'.$querystring_separator.$title;


and in the main b2 loop in my index file, I've changed the category link from
Code:
<a href="?cat=<?php the_category_ID() ?>" title="category: <?php the_category() ?>"><span class="storyCategory">[<?php the_category() ?>]</span></a> by 

to
Code:
<a href="<?=$siteurl.'/'.$blogfilename.$querystring_start.'cat'.$querystring_equal.$postdata['Category'].$querystring_separator.get_the_category()?>" title="category: <?php the_category() ?>"><span class="storyCategory">[<?php the_category() ?>]</span></a> by 


I've also made similar changes in GamerZ' b2stats hack and Dodo's full archives hack

As I mentioned I don't think this is the most elegant solution. Particularly the
use of preg_replace(); I think that could be done with the new filters, but I've
not yet got my head around those.


Hope this is useful to someone.


Mike
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
dtdgoomba



Joined: 05 Aug 2002
Posts: 179
Location: Cambridge, MA

PostPosted: Mon Nov 25, 2002 11:46 pm    Post subject: Reply with quote

Ok, I've been trying this out and it just brings up errors that it can't find that directory (since it's not a directory). I have b2-0.6.1-20021104 as my version. This is what I've done so far:

-Rename 'example.htaccess' into '.htaccess'
-Open b2config.php, and find these three lines:
- 1. $querystring_start = '?';
2. $querystring_equal = '=';
3. $querystring_separator = '&amp;';

Changed all the values to '/', like this:

1. $querystring_start = '/';
2. $querystring_equal = '/';
3. $querystring_separator = '/';


-Changed my b2config to have this, it was formally index.php:

1. $blogfilename = 'archives';

Uploaded .htaccess, 'archives', and b2config.php files

--------------------------
At this point, I do get the /m/200211 in the address when I click the links for my b2archives, but I just get an error that that URL was not found

http://anthony.torres.name/archives/m/200211 is the resulting error. Is there something else I'm supposed to do?

The only difference between my b2archives and the one in the zip file is that I had to comment out:
//require_once('./b2config.php');
//require_once($b2inc.'/b2functions.php');

in order to have the php not stop going on my page b/c otherwise my php would just stop right at that part.

I know of lot of the posts are out of date b/c the newer version of b2 that I'm using had already made some of the changes you all talked about. Let me know if you need more info from me.
Back to top
View user's profile Send private message Visit poster's website
imeridian



Joined: 12 Feb 2002
Posts: 191

PostPosted: Tue Nov 26, 2002 1:33 am    Post subject: Reply with quote

Your 'archives' file isn't parsing as php ( http://anthony.torres.name/archives ) which is the core problem. It could be that your host has disallowed the .htaccess directives that allow it to be parsed as php, or it could be that you've not moved the .htaccess into your document root for the domain... I'm not sure, but I believe that in the distribution files of b2, example.htaccess is in the tools subdirectory (I'd have to look), if it is you need to move it up to where the 'archives' file is. If it is there, and you have the correct syntax in the .htaccess file (it should be fine if you just renamed it) then you might want to check with your host to see if they allow changing the filetype via .htaccess. Also, I'm not sure if it's my browser or the file itself, but there appears to be a space between the <? and php, like <? php instead of <?php, double check that too.
_________________
-indi<br>
http://indiboi.com
http://artlikepornstars.com
http://www.positivefusion.com
Back to top
View user's profile Send private message Visit poster's website
macshack



Joined: 17 Jul 2002
Posts: 1204
Location: Phoenix, Az

PostPosted: Tue Nov 26, 2002 1:36 am    Post subject: Reply with quote

Hi,

indi just answered your post... He's quick

michael e
Back to top
View user's profile Send private message Send e-mail
dtdgoomba



Joined: 05 Aug 2002
Posts: 179
Location: Cambridge, MA

PostPosted: Tue Nov 26, 2002 1:43 am    Post subject: Reply with quote

Thanks! I'll check it all out and let you know what happened. Should be easy since our company runs the server and my roommate is the tech guy!

While I do that, I was asking someone else about this and they asked why I'm not using mod_rewrite to take care of it all. I know little about that and was reading the apache docs on it. Can anyone explain why it should/shouldn't be used as a URL changing alternative?
Back to top
View user's profile Send private message Visit poster's website
imeridian



Joined: 12 Feb 2002
Posts: 191

PostPosted: Tue Nov 26, 2002 1:52 am    Post subject: Reply with quote

This is just better... ;-) Before this came along I was using mod_rewrite to make urls like /archives/2002/11/25, which is nice, but there is extra overheard for the server in processing urls and rewriting them, plus it isn't integrated into b2's url generation, so while it's good for 'external' urls, it doesn't work so well for all the different links you'd make on the page itself through b2. Additionally, while mod_rewrite is fairly common, I know a lot of servers that don't have it available... if someone makes even a very tiny mistake it can cause serious problems with server load, and of course then the support staff have to deal with explaining to someone why every single page on their site is an internal server error.... and trust me, it happens a lot.
_________________
-indi<br>
http://indiboi.com
http://artlikepornstars.com
http://www.positivefusion.com
Back to top
View user's profile Send private message Visit poster's website
dtdgoomba



Joined: 05 Aug 2002
Posts: 179
Location: Cambridge, MA

PostPosted: Tue Nov 26, 2002 4:33 am    Post subject: Reply with quote

It was that .htaccess was disabled. Just found out now. I have to go through and correct my files to have the / for files and the css. I'll get the other hacks here going, like the category ids and names and such and let you know if I have any problems. I don't mind testing things out and having people see if they've had the same issue
Back to top
View user's profile Send private message Visit poster's website
dtdgoomba



Joined: 05 Aug 2002
Posts: 179
Location: Cambridge, MA

PostPosted: Tue Nov 26, 2002 6:22 am    Post subject: Reply with quote

I'm actually going to revert back before I leave town. The .htaccess is causing problems and since my roommate is leaving too, it won't be fixed until next week.

Somehow the file stopped my shoutbox from working. I'll update you all later and play more when i get back.

happy thanksgiving...
Back to top
View user's profile Send private message Visit poster's website
imeridian



Joined: 12 Feb 2002
Posts: 191

PostPosted: Tue Nov 26, 2002 6:28 am    Post subject: Reply with quote

Take out the bit about register globals.... you don't need that, and that's what is undoubtedly causing your shoutbox to stop working.
_________________
-indi<br>
http://indiboi.com
http://artlikepornstars.com
http://www.positivefusion.com
Back to top
View user's profile Send private message Visit poster's website
dtdgoomba



Joined: 05 Aug 2002
Posts: 179
Location: Cambridge, MA

PostPosted: Tue Nov 26, 2002 6:31 am    Post subject: Reply with quote

damn you're quick... that was it

the other problem I have is something I gotta sort out with the server. the htaccess isn't set up correctly to allow my webdav

thanks for the quick reply and help
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> How to ? All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2 © 2001, 2002 phpBB Group