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 

b2archives hack V1.02
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    boardom Forum Index -> Hacks
View previous topic :: View next topic  
Author Message
dodo



Joined: 25 Jan 2002
Posts: 35

PostPosted: Sat Aug 31, 2002 8:45 pm    Post subject: b2archives hack V1.02 Reply with quote

i updated my b2 archives hack. in case you are interested.

it sorts by years also now.

to read more about the old version

go here and here

examples for the new version
http://pure-essence.net/b2archives.php

i've also tested it here
http://regretless.com/dodo/pure/b2/b2archives.php

to download
http://regretless.com/dodo/pure/b2/hacks/b2archivesV1_02.zip

i just want to share this hack. if you need help on anything, discuss it here.
_________________
http://pure-essence.net

b2 rocks
Back to top
View user's profile Send private message Visit poster's website
.Chris



Joined: 30 Apr 2002
Posts: 186
Location: Hawaii

PostPosted: Sat Aug 31, 2002 8:49 pm    Post subject: Reply with quote

Yummy..
Back to top
View user's profile Send private message Visit poster's website
Sansnom



Joined: 31 Jan 2002
Posts: 94
Location: Paris

PostPosted: Sun Sep 01, 2002 5:41 pm    Post subject: Reply with quote

Great Job !!!

I'm just asking myself if it's possible to format the date (in front of the posts) in a french style.
Example :
"26 juillet 2002 15h12"
instead of
"2002.07.26 15.12.02"

I know I'm too slow to answer, so I hope you will ! Cool

Bravo again !!!

S

_________________
http://www.sansfin.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
annia



Joined: 09 Apr 2002
Posts: 18

PostPosted: Mon Sep 02, 2002 2:55 pm    Post subject: Reply with quote

looks good dodo :) thanks for sharing!!
Back to top
View user's profile Send private message
daynah



Joined: 25 Jan 2002
Posts: 8

PostPosted: Mon Sep 09, 2002 5:51 pm    Post subject: Reply with quote

Some people are wondering how to format the date to just show the day, rather than all the times. So here's the small modification. Smile

Starting on line 116, replace:

Code:
$postdata = get_postdata2($row->ID);
echo $postdata["Date"];


with:
Code:
$postdata = get_postdata2($row->ID);
$post_date = explode(" ", $postdata["Date"]);
echo $post_date[0];


What this does is puts the date into an array, separated by a " " (space). So $post_date[0] gets the day, while $post_date[1] gets the time.

I hope that helps!
_________________
PHP Princess.net | Daynah.net
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
dille



Joined: 28 Aug 2002
Posts: 9
Location: Netherlands

PostPosted: Fri Sep 13, 2002 8:54 am    Post subject: Hm... doesn't work here... Reply with quote

I downloaded, expanded and put the b2archivetest.php file in the same dir as my blog. I then changed the settings.

When I visit http://dille.ath.cx/b2archivestest.php (where the file is), I get:
Quote:

Warning: Access denied for user: 'root@localhost' (Using password: NO) in /Library/WebServer/home/b2archivestest.php on line 29

Warning: MySQL Connection Failed: Access denied for user: 'root@localhost' (Using password: NO) in /Library/WebServer/home/b2archivestest.php on line 29

Warning: MySQL: A link to the server could not be established in /Library/WebServer/home/b2archivestest.php on line 29


Which is not what it should be. Anyone had this before?
Back to top
View user's profile Send private message Visit poster's website
daynah



Joined: 25 Jan 2002
Posts: 8

PostPosted: Fri Sep 13, 2002 9:20 am    Post subject: Reply with quote

I think you have to rename the file to b2archives.php

Else, you can edit line 18:

change:
if ($pagenow == "b2archives.php")

to
if ($pagenow == "b2archivestest.php")

Smile Hope that helps.
_________________
PHP Princess.net | Daynah.net
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Tanner



Joined: 06 Jul 2002
Posts: 55
Location: Germany

PostPosted: Fri Sep 13, 2002 12:58 pm    Post subject: Reply with quote

Here it only shows:

Warning: Supplied argument is not a valid MySQL result resource in /home/www/web243/html/playground/b2archivestest.php on line 198
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
dille



Joined: 28 Aug 2002
Posts: 9
Location: Netherlands

PostPosted: Mon Sep 16, 2002 10:18 pm    Post subject: Reply with quote

daynah: nope, tried that (both options), didn't work. However, in the end I decided to use a different solution anyway, so the problem is gone, sort of =]
Back to top
View user's profile Send private message Visit poster's website
gambetti



Joined: 24 Sep 2002
Posts: 1

PostPosted: Tue Sep 24, 2002 2:59 pm    Post subject: the same prob. :Supplied argument is not a valid Reply with quote

I have the same problem after installing and running the script:

Warning: Supplied argument is not a valid MySQL result resource in /.../.../.../kunden/b2/b2archivestest.php on line 101

line 101 is:

100>> } elseif ($archive_mode == "postbypost") {
101>> while($row=mysql_fetch_object($result)) {
102>> $postdata = get_postdata2($row->ID);
103>> $thismonth=mysql2date("Y\-m", $postdata["Date"]);
104>> $linkmonth=mysql2date("Ym", $postdata["Date"]);

anybody a idea?
thanks in advance!!

gambetti
Back to top
View user's profile Send private message
Aubrey



Joined: 18 Jun 2002
Posts: 6

PostPosted: Tue Sep 24, 2002 5:39 pm    Post subject: Reply with quote

I'm getting the same thing... not sure how to fix it, however...
_________________
you seem star shaped.
Back to top
View user's profile Send private message
chobits



Joined: 25 Sep 2002
Posts: 2

PostPosted: Wed Sep 25, 2002 10:46 pm    Post subject: Reply with quote

i am also getting an error from line 101

Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in ....b2archivestest.php on line 101
Back to top
View user's profile Send private message
daynah



Joined: 25 Jan 2002
Posts: 8

PostPosted: Fri Sep 27, 2002 10:25 pm    Post subject: Reply with quote

On line 28 or so, find

[php:1:ae25c39cc2]$request = " SELECT * FROM posts WHERE post_date LIKE '$year%' ORDER BY $way $order"; [/php:1:ae25c39cc2]

and replaced it with

[php:1:ae25c39cc2]$request = " SELECT * FROM $tablename WHERE post_date LIKE '$year%' ORDER BY $way $order"; [/php:1:ae25c39cc2]

That should fix the errors. Smile
_________________
PHP Princess.net | Daynah.net
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
plazz2000



Joined: 01 Apr 2002
Posts: 40
Location: Cork, Ireland

PostPosted: Sat Sep 28, 2002 1:23 pm    Post subject: Reply with quote

dodo,

I love your hack.

How do I get it to show only, say, 10 headlines at once?
Back to top
View user's profile Send private message
dodo



Joined: 25 Jan 2002
Posts: 35

PostPosted: Wed Nov 06, 2002 6:17 am    Post subject: Reply with quote

daynah wrote:
On line 28 or so, find

[php:1:13fec41725]$request = " SELECT * FROM posts WHERE post_date LIKE '$year%' ORDER BY $way $order"; [/php:1:13fec41725]

and replaced it with

[php:1:13fec41725]$request = " SELECT * FROM $tablename WHERE post_date LIKE '$year%' ORDER BY $way $order"; [/php:1:13fec41725]

That should fix the errors. Smile

thanks daynah, i make stupid errors. i should probably fix my zip file.
_________________
http://pure-essence.net

b2 rocks
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 -> Hacks All times are GMT + 1 Hour
Goto page 1, 2, 3  Next
Page 1 of 3

 
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