 |
boardom b2 message board
|
View previous topic :: View next topic |
Author |
Message |
yewel
Joined: 20 Nov 2002 Posts: 5 Location: melbourne
|
Posted: Wed Nov 20, 2002 10:23 pm Post subject: request : keeping description within the title tags |
|
|
hi!
this is a fantastic hack!
i've just installed it last night at http://adrian.newyew.net/thedailygrind
i was wondering how i can work the code such that when displaying text links (see the section at the top entitled "Inside Yew"), the description of the link is not echoed again after going into the title="describtion" area
i.e.
i would like my text links to show :
<a href="link_url[i]" title="[i]description" target="top">link_text</a>
instead of
<a href="link_url[i]" title="[i]description" target="top">link_text</a> description
cheers! |
|
Back to top |
|
 |
mikelittle
Joined: 11 May 2002 Posts: 376 Location: UK
|
Posted: Thu Nov 21, 2002 12:49 am Post subject: |
|
|
Folks,
There is yet another new version of the B2 Link Manager available. Version 0.9
You can obtain it from the B2 Link Manager page.
New features:
* URLs are optional.
* Delete asks for confirmation.
* You can now turn off the descriptions, even if you have no image
defined or have images turned off.
This last one just for you yewel
Feedback, bug reports/fixes, and general comments appreciated.
Still on the todo list:
* Sort out the bookmarklets thing.
* Arbitrary display order.
* Remember the show option from page to page.
Enjoy,
Mike _________________ Mike Little
http://zed1.com/journalized/
"Share what you know. Learn what you don't." |
|
Back to top |
|
 |
MiniSizeIt
Joined: 02 Nov 2002 Posts: 70
|
Posted: Thu Nov 21, 2002 1:13 am Post subject: |
|
|
Amazing work mikelittle! I'll be sure to update my version when I get to my server tomorrow. Keep up the great work  |
|
Back to top |
|
 |
yewel
Joined: 20 Nov 2002 Posts: 5 Location: melbourne
|
Posted: Thu Nov 21, 2002 6:46 am Post subject: links update |
|
|
you are a gem!
thank you!!!!
i haven't quite figured out how to get the syntax to hide the dsescription when i have a mix of images and test links in the same category, but don't worry, i'll work it out.  |
|
Back to top |
|
 |
albert
Joined: 11 Oct 2002 Posts: 52
|
Posted: Fri Nov 22, 2002 3:48 am Post subject: |
|
|
you just keep pumping these updates out dont you? _________________ "so fresh so clean" |
|
Back to top |
|
 |
lordscarlet
Joined: 27 Nov 2002 Posts: 4 Location: Fredericksburg, VA
|
Posted: Wed Nov 27, 2002 2:51 pm Post subject: |
|
|
Could you possibly create a build script for the MySQL tables? Some of us don't have telnet or phpMyAdmin access  |
|
Back to top |
|
 |
mikelittle
Joined: 11 May 2002 Posts: 376 Location: UK
|
Posted: Thu Nov 28, 2002 12:02 am Post subject: |
|
|
Hi Lordscarlet,
Yes I will turn the table creation into a php script. I've been pretty much asked the same thing for another of my hacks.
I'll work on it now.... _________________ Mike Little
http://zed1.com/journalized/
"Share what you know. Learn what you don't." |
|
Back to top |
|
 |
mikelittle
Joined: 11 May 2002 Posts: 376 Location: UK
|
Posted: Thu Nov 28, 2002 1:09 am Post subject: |
|
|
OK. Here is a first pass at a table creation script. Upload this to your B2 directory as b2links.install.php and 'call' it with your browser http://www.your.domain/b2links.install.php
[php:1:35552611f2]<?php
// $Id$
//
// B2 Link Manager
// Copyright (C) 2002 Mike Little -- [email protected]
//
// This is an add-on to b2 weblog / news publishing tool
// b2 is copyright (c)2001, 2002 by Michel Valdrighi - [email protected]
//
// **********************************************************************
// Copyright (C) 2002 Mike Little
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// Mike Little ([email protected])
// *****************************************************************
// Start Connect To MYSQL
require_once("b2config.php");
include_once("$b2inc/b2vars.php");
include_once("$b2inc/b2functions.php");
$tablelinks = "b2links";
$tablelinkcategories = "b2linkcategories";
$got_links = false;
$got_cats = false;
$got_row = false;
?><html>
<head>
<title>b2 > Installation</title>
</head>
<body>
<p>Checking for tables...</p>
<?php
$result = mysql_list_tables($dbname);
if (!$result) {
print "DB Error, could not list tables\n";
print 'MySQL Error: ' . mysql_error();
exit;
}
while ($row = mysql_fetch_row($result)) {
if ($row[0] == $tablelinks)
$got_links = true;
if ($row[0] == $tablelinkcategories)
$got_cats = true;
//print "Table: $row[0]<br />\n";
}
if (!$got_cats) {
echo "<p>Can't find table '$tablelinkcategories', gonna create it...</p>\n";
$sql = "CREATE TABLE $tablelinkcategories ( " .
" cat_id int(11) NOT NULL auto_increment, " .
" cat_name tinytext NOT NULL, ".
" PRIMARY KEY (cat_id) ".
") ";
$result = mysql_query($sql) or print ("Can't create the table '$tablelinkcategories' in the database.<br />" . $sql . "<br />" . mysql_error());
if ($result != false) {
echo "<p>Table '$tablelinkcategories' created OK</p>\n";
$got_cats = true;
}
} else {
echo "<p>Found table '$tablelinkcategories', don't need to create it...</p>\n";
}
if (!$got_links) {
echo "<p>Can't find '$tablelinks', gonna create it...</p>\n";
$sql = "CREATE TABLE $tablelinks ( " .
" link_id int(11) NOT NULL auto_increment, " .
" link_url varchar(255) NOT NULL default '', " .
" link_name varchar(255) NOT NULL default '', " .
" link_image varchar(255) NOT NULL default '', " .
" link_target varchar(25) NOT NULL default '', " .
" link_category int(11) NOT NULL default 0, " .
" link_description varchar(255) NOT NULL default '', " .
" link_visible enum ('Y','N') NOT NULL default 'Y', " .
" link_owner int NOT NULL DEFAULT '1', " .
" PRIMARY KEY (link_id) " .
") ";
$result = mysql_query($sql) or print ("Can't create the table '$tablelinks' in the database.<br />" . $sql . "<br />" . mysql_error());
if ($result != false) {
echo "<p>Table '$tablelinks' created OK</p>\n";
$got_links = true;
}
} else {
echo "<p>Found table '$tablelinks', don't need to create it...</p>\n";
}
if ($got_links && $got_cats) {
echo "<p>Looking for category 1...</p>\n";
$sql = "SELECT * FROM $tablelinkcategories WHERE cat_id=1 ";
$result = mysql_query($sql) or print ("Can't query '$tablelinkcategories'.<br />" . $sql . "<br />" . mysql_error());
if ($result != false) {
if ($row = mysql_fetch_object($result)) {
echo "<p>You have at least got category 1. Good!</p>\n";
$got_row = true;
} else {
echo "<p>Gonna insert category 1...</p>\n";
$sql = "INSERT INTO b2linkcategories (cat_id, cat_name) VALUES (1, 'General')";
$result = mysql_query($sql) or print ("Can't query insert category.<br />" . $sql . "<br />" . mysql_error());
if ($result != false) {
echo "<p>Inserted category Ok</p>\n";
$got_row = true;
}
}
}
}
if ($got_row) {
echo "<p>All done.</p>\n";
}
?>
</body>
</html>
[/php:1:35552611f2]
Let me know of any problems. I'll include this in the next release.
Mike _________________ Mike Little
http://zed1.com/journalized/
"Share what you know. Learn what you don't." |
|
Back to top |
|
 |
mikelittle
Joined: 11 May 2002 Posts: 376 Location: UK
|
Posted: Fri Nov 29, 2002 1:08 am Post subject: New Version |
|
|
Folks,
There is a new version available, 0.9.1
This a very minor update: I've simply of added the DB install script I posted earlier.
You can get it from the B2 Link Manager page.
Enjoy,
Mike _________________ Mike Little
http://zed1.com/journalized/
"Share what you know. Learn what you don't." |
|
Back to top |
|
 |
lordscarlet
Joined: 27 Nov 2002 Posts: 4 Location: Fredericksburg, VA
|
Posted: Fri Nov 29, 2002 3:03 pm Post subject: |
|
|
After the includes at the top of b2links.install.php you should add:
Code: |
$connexion = mysql_connect($server,$loginsql,$passsql) or die("Can't connect to the database<br>".mysql_error());
$dbconnexion = mysql_select_db($base, $connexion);
|
|
|
Back to top |
|
 |
mikelittle
Joined: 11 May 2002 Posts: 376 Location: UK
|
Posted: Sat Nov 30, 2002 1:12 am Post subject: |
|
|
Hmmm, that's interesting, because I didn't need to do that.
I developed and tested it without any problems. I kept dropping the tables or deleting the rows to check I'd got all my logic correct. But I never had any trouble connecting.
I developed and tested it under Windows, I wonder if that make any difference?
Did you get it working then? _________________ Mike Little
http://zed1.com/journalized/
"Share what you know. Learn what you don't." |
|
Back to top |
|
 |
lordscarlet
Joined: 27 Nov 2002 Posts: 4 Location: Fredericksburg, VA
|
Posted: Sat Nov 30, 2002 3:35 am Post subject: |
|
|
i don't know if windows had to do with it or not. It kept trying to login as nobody@localhost or something..r ather than having the correct login. there may be something with windows DSN's that keep it from having that problem. So, if anyone has login problems do what I did. but yes, it ended up working. |
|
Back to top |
|
 |
mikelittle
Joined: 11 May 2002 Posts: 376 Location: UK
|
Posted: Sun Dec 29, 2002 11:09 pm Post subject: New Release B2 Link Manager Version 1.0 |
|
|
Folks,
B2 Link Manager has made it to version 1.0!
This new release includes:
A fix to the install script.
A separate configuration file.
A cookie to remember 'show' filter setting when managing links.
A ratings system.
An auto-toggle category flag.
and the sort order can now be descending.
Of particular interest is the rating system which includes the ability to display images to indicate the rating of a link. And the auto-toggle category flag which forces only one link in that category to be visible, automatically toggling the others nvisible. Think 'current CD' or 'current mood'.
You can find a zip file and tarball at the b2 link manager page.
As ususal, comments, bug reports, etc to this topic please.
Still to do:
* Arbitrary ordering. (But you can use the rating system for now)
* Sidebar/favelets thing.
Enjoy,
Mike _________________ Mike Little
http://zed1.com/journalized/
"Share what you know. Learn what you don't." |
|
Back to top |
|
 |
mikelittle
Joined: 11 May 2002 Posts: 376 Location: UK
|
Posted: Thu Jan 02, 2003 2:00 am Post subject: |
|
|
Oops, I forgot to update the install script with the table changes for this release.
You can get the updated version from http://zed1.com/b2links/b2links.install.php.txt
save it as b2links.install.php and run it to create the tables.
This is only needed if you are installing for the first time, if you are upgrading there is b2links.update-1.0.sql
I guess I need to incorporate a PHP update script too. Hmmm, maybe in the next release.
Mike _________________ Mike Little
http://zed1.com/journalized/
"Share what you know. Learn what you don't." |
|
Back to top |
|
 |
lg
Joined: 05 Jan 2003 Posts: 8 Location: Oxford, MS, USA
|
Posted: Sun Jan 05, 2003 10:23 pm Post subject: Fix for 1.0 |
|
|
I installed the Link Manager 1.0, and have made a fix. When I tried adding a link category with auto-toggle unchecked, I got the error "Couldn't add category...". I tracked it down to the $auto_toggle being blank when updating the database. Here's my fix:
b2linkcategories.php
change both lines shown
Code: | $auto_toggle=$HTTP_POST_VARS["auto_toggle"];
$query="INSERT INTO $tablelinkcategories (cat_id,cat_name, auto_toggle) VALUES ('0', '$cat_name', $auto_toggle)"; |
to
Code: | $auto_toggle= $HTTP_POST_VARS["auto_toggle"]=='Y'?'Y':'N';
$query="INSERT INTO $tablelinkcategories (cat_id,cat_name, auto_toggle) VALUES ('0', '$cat_name', '$auto_toggle')"; |
Thanks for writing this! I was looking for some type of link page to use with b2.
--Loyd |
|
Back to top |
|
 |
|
|
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
|