View previous topic :: View next topic |
Author |
Message |
Anneli
Joined: 08 Nov 2003 Posts: 4
|
Posted: Thu Dec 11, 2003 12:32 pm Post subject: b2archives.php suddenly changing... |
|
|
I have b2 in its own directory, and I've also installed Dodo's archive hack, v1.02, and everything was working perfect. Then I changed my site layout, and stuff went kaplooey.
Suddenly, all the links to the individual entries in b2archives.php are pointing to e.g. http://never-free.net/index.php?p=166&c=1 when I want them to point to http://never-free.net/b2/index.php?p=166&c=1
What do I have to change? I've tried changing the variables for the blog filename and the site url, and I've tried fiddling around with the part of the code where the link is created, but no luck. *frustrated* Anybody know what I have to change? |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 986 Location: Washington
|
Posted: Thu Dec 11, 2003 11:34 pm Post subject: |
|
|
Look for the variables "$archive_link_" in that file and change the path. _________________ Michael P. |
|
Back to top |
|
 |
Anneli
Joined: 08 Nov 2003 Posts: 4
|
Posted: Sat Dec 13, 2003 9:29 am Post subject: |
|
|
I can't fins those variables. I'm using Dodo's archive hack? This is the code for my b2archives.php page:
Code: |
<?php include('http://never-free.net/top.txt'); ?>
<?php
// What's the default list order?
$defaultorderby = "ID";
// Default to ascending to descending?
$defaultorder = "DESC";
// What's your blog file name?
$blogfilename = "index.php";
// What's your site url? (no trailing slash)
$siteurl = "http://never-free.net";
// What's the name of the table for your posts?
$tablename = "b2posts";
// What's the first year you started your b2?
$first_year = "2003";
$this_year = date("Y");
$pagenow = explode("/", $PHP_SELF);
$pagenow = trim($pagenow[(sizeof($pagenow)-1)]);
if ($pagenow == "b2archives.php")
include ("blog.header.php");
if(!$way)
$way = "ID";
if(!$order)
$order = "DESC";
if(!$year)
$year = $this_year;
$archive_mode = "postbypost";
$request = " SELECT * FROM $tablename WHERE post_date LIKE '$year%' ORDER BY $way $order";
$result = mysql_query($request);
echo "Archives:";
######################################################
# Feel free to modify the following
######################################################
?>
<form action="<?=$PHP_SELF?>" method="post">
Order by
<select class="form" name="way">
<?
if($way == "ID")
echo '<option value="ID" selected>ID</option>';
else
echo '<option value="ID">ID</option>';
if($way == "post_date")
echo '<option value="post_date" selected>date</option>';
else
echo '<option value="post_date">date</option>';
if($way == "post_title")
echo '<option value="post_title" selected>title</option>';
else
echo '<option value="post_title">title</option>';
?>
</select>
<select class="form" name="order">
<?
if($order == "ASC")
echo '<option value="ASC" selected>Ascending</option>';
else
echo '<option value="ASC">Ascending</option>';
if($order == "DESC")
echo '<option value="DESC" selected>Descending</option>';
else
echo '<option value="DESC">Descending</option>';
?>
</select>
<select class="form" name="year">
<? for($i = $first_year; $i <= $this_year; $i++) {
if($year == $i)
echo "<option value=\"$i\" selected>$i</option>";
else
echo "<option value=\"$i\">$i</option>";
}
?>
</select>
<input type="submit" name="submit" value="sort" />
</form>
<?php
if ($archive_mode == "monthly") {
while($row=mysql_fetch_object($result)) {
$postdata = get_postdata2($row->ID);
$thismonth=mysql2date("Y\-m", $postdata["Date"]);
$linkmonth=mysql2date("Ym", $postdata["Date"]);
$i = "/".$thismonth."/";
if ($thismonth != $previousmonth) {
if (preg_match($i,$postdata["Date"])) {
echo "<a href=\"$siteurl/".$blogfilename."?m=$linkmonth\">";
echo $month[substr($thismonth,5,2)];
echo "</a>";
echo "<br>\n";
}
}
$previousmonth = $thismonth;
}
} elseif ($archive_mode == "postbypost") {
while($row=mysql_fetch_object($result)) {
$postdata = get_postdata2($row->ID);
$thismonth=mysql2date("Y\-m", $postdata["Date"]);
$linkmonth=mysql2date("Ym", $postdata["Date"]);
$i = "/".$thismonth."/";
if ($thismonth != $previousmonth) {
if (preg_match($i,$postdata["Date"])) {
echo "<br><a href=\"$siteurl/".$blogfilename."?m=$linkmonth\">";
echo $month[substr($thismonth,5,2)];
echo "</a>";
echo "<br>\n";
}
}
$previousmonth = $thismonth;
$postdata = get_postdata2($row->ID);
echo $postdata["Date"];
echo " - <a href=\"$siteurl/".$blogfilename."?p=".$row->ID."&c=1"."\">";
if ($postdata["Title"]) {
$postdata["Title"] = stripslashes($postdata["Title"]);
echo $postdata["Title"];
} else {
echo $postdata["ID"];
}
echo "</a>";
echo "<br>\n";
}
}
?>
<form name="searchform" action="<?=$blogfilename?>" method="get">
<input type="text" name="s" class="form" />
<input type="submit" name="submit" value="search" class="form" />
</form>
<?
?>
<?php include('http://never-free.net/bottom.txt'); ?>
|
|
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 986 Location: Washington
|
Posted: Sat Dec 13, 2003 4:34 pm Post subject: |
|
|
Have you tried changing the following....?
Code: |
// What's your site url? (no trailing slash)
$siteurl = "http://never-free.net";
|
to
Code: |
// What's your site url? (no trailing slash)
$siteurl = "http://never-free.net/b2";
|
Please ask the original author of the hack for further assistance. _________________ Michael P. |
|
Back to top |
|
 |
Anneli
Joined: 08 Nov 2003 Posts: 4
|
Posted: Sat Dec 13, 2003 9:46 pm Post subject: |
|
|
Anneli wrote: | I've tried changing the variables for the blog filename and the site url, |
Yep.
I'll try contacting Dodo. Thanks, anyway.  |
|
Back to top |
|
 |
|