View previous topic :: View next topic |
Author |
Message |
indiaberry
Joined: 09 Mar 2003 Posts: 8
|
Posted: Mon Mar 10, 2003 7:39 am Post subject: |
|
|
ok, this work...but
The only thing in the catogetries drop down box is, "All Categories"
What can I do to put in all the catogetries..so that when a person click a name of catogetries, it um..show only entries in that categories. |
|
Back to top |
|
 |
macshack
Joined: 17 Jul 2002 Posts: 1204 Location: Phoenix, Az
|
Posted: Mon Mar 10, 2003 8:11 am Post subject: |
|
|
Hi,
The template function
Code: |
<?php list_cats(0, '', 'name'); ?>
|
should give a list of categories ordered by their names.
If you wanted in the list a link for 'All songs' for example, then you could use:
Code: |
<?php list_cats(1, 'All songs', 'name'); ?>
|
_________________ Kind Regards,
Michael e |
|
Back to top |
|
 |
indiaberry
Joined: 09 Mar 2003 Posts: 8
|
Posted: Mon Mar 10, 2003 8:12 am Post subject: |
|
|
qingshuo wrote: | Here it is:
<select class="form" name="cat" style="width:110px;">
<?
$catsResult = mysql_query(" SELECT * FROM qnetb2categories ");
while ( $catRow = mysql_fetch_array($catsResult) ) {
echo '<option value="'.$catRow["cat_ID"].'"';
if($cat == $catRow["cat_ID"])
echo ' selected="selected"';
echo '>'.$catRow["cat_name"]."</option>\n";
}
echo '<option value="all_cats"';
if($cat == "all_cats")
echo ' selected="selected"';
echo ">All Categories</option>\n";
|
remove the "qnet" off bnetb2categories if you want it to show all the name of categories. Now I know, just helping other out. |
|
Back to top |
|
 |
neil
Joined: 12 Apr 2003 Posts: 9
|
Posted: Tue Apr 15, 2003 12:37 am Post subject: |
|
|
i'm sure this is probably not too difficult, but i'm not too good with PHP so bear with me...
i haven't actually implemented this yet, but i plan on using b2 to power an events calendar -- using the same hacks that others have used to enable posts in the "future" appear.
with this in mind, i'd like to use this code to sort my event entries, but only events that occur from the current date or later. essentially, is there any way to implement this sorting code with the current blog?
i understand that i can already sort by category for current posts, etc, but i'd like to be able to sort current posts by other criteria, like title or possibly even customfields.
i hope i'm making sense...my brain has been flooded with ideas since i've thought about implementing b2 on sites other than "standard" blogs. |
|
Back to top |
|
 |
nullswitch
Joined: 07 Mar 2003 Posts: 14 Location: Carnegie Mellon, Pittsburgh
|
Posted: Thu Apr 24, 2003 10:33 pm Post subject: |
|
|
I'm not getting anyoutput at all Basically, I get the form and thats it- no database output. The original b2archives.php works fine but yours and Dodo's just sit there...
Installation problem? It might be that the query is returning anything.... _________________ "Whatever you do, at least be of some use" |
|
Back to top |
|
 |
qingshuo
Joined: 03 Jan 2003 Posts: 10 Location: Edina-Bloomington/MN/USA
|
Posted: Sat Apr 26, 2003 5:55 pm Post subject: |
|
|
Yeah, I use database/tablenames different from the default, and some of the "qnet" stuff seeped into the code. My apologies =\
Just search/replace and comb out all the "qnet"'s and things should be fine =\ |
|
Back to top |
|
 |
dodo
Joined: 25 Jan 2002 Posts: 35
|
Posted: Fri May 09, 2003 11:51 pm Post subject: |
|
|
hey good job.. what's movement? _________________ http://pure-essence.net
b2 rocks |
|
Back to top |
|
 |
gooified
Joined: 09 Jul 2003 Posts: 19
|
Posted: Thu Oct 30, 2003 7:47 pm Post subject: |
|
|
I'm getting this error:
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/gooified/public_html/b2/b2archives.php on line 111
...line 111 is this:
while($row=mysql_fetch_object($result)) {
?? |
|
Back to top |
|
 |
sayiklamalar
Joined: 23 Apr 2003 Posts: 6 Location: Turkey
|
Posted: Wed Feb 02, 2005 8:33 pm Post subject: |
|
|
hi!
i found this code after a big tiredness. couse the original code (dodo's one) not reachable with the adress given. if i can find someone to answer my question i'll be glad.
i want to see author names in the order, near the date. but i couldn't write the correct sql query for it. |
|
Back to top |
|
 |
Firithlaith
Joined: 24 Jan 2005 Posts: 2
|
Posted: Sat Feb 05, 2005 3:28 pm Post subject: |
|
|
May anyone help me?
I always get this message:
Warning: mysql_query(): Access denied for user: 'ncf302@localhost' (Using password: NO) in /home/www/ncf302/html/sillie/b2/archive.php on line 50
Warning: mysql_query(): A link to the server could not be established in /home/www/ncf302/html/sillie/b2/archive.php on line 50
Sort By:
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/www/ncf302/html/sillie/b2/archive.php on line 142 |
|
Back to top |
|
 |
|