Because it's in FULLTEXT, which is only supported for MySQL.
302 2008-01-08 20:15
Re: check_cookie function log message (6 replies, posted in PunBB 1.2 discussion)
Try logging out and in again. Have others do that too.
303 2008-01-06 14:31
Re: I get this error message, any ideas how to fix it (40 replies, posted in PunBB 1.2 troubleshooting)
You'd be better off upgrading, if that's even possible.
304 2008-01-04 20:36
Re: RSS feeds from database + associated data (skip NULL in MySQL output) (92 replies, posted in Programming)
The first bit you are correct about yes.
The second bit is merely accessing the SimplePie class, had to digg through the code a bit for that
305 2008-01-04 19:33
Re: RSS feeds from database + associated data (skip NULL in MySQL output) (92 replies, posted in Programming)
See if this works:
<?php
// Include the SimplePie library
require_once 'simplepie.inc';
require 'shorten.php';
// Because we're using multiple feeds, let's just set the headers here.
header('Content-type:text/html; charset=utf-8');
// These are the feeds we want to use
mysql_connect(localhost,$db_username,$db_password);
@mysql_select_db($db_name) or die( "Unable to select database");
$query = "SELECT id, firstname, username, rssfeed FROM members WHERE rssfeed != ''";
$result = mysql_query($query);
$feeds = array();
$id_array = array();
$first = array();
$user = array();
$userinfo = array();
while ($cur_feed = mysql_fetch_assoc($result))
{
$feeds[] = $cur_feed['rssfeed'];
$userinfo[$cur_feed['rssfeed']] = $cur_feed;
}
// This array will hold the items we'll be grabbing.
$first_items = array();
// Let's go through the array, feed by feed, and store the items we want.
$ix = 0;
foreach ($feeds as $url)
{
$user_id = $id_array[$ix];
$firstname = $first[$ix];
$username = $user[$ix];
$ix++;
// Use the long syntax
$feed = new SimplePie();
$feed->set_feed_url($url);
$feed->init();
// How many items per feed should we try to grab?
$items_per_feed = 1;
// As long as we're not trying to grab more items than the feed has, go through them one by one and add them to the array.
for ($x = 0; $x < $feed->get_item_quantity($items_per_feed); $x++)
{
$first_items[] = $feed->get_item($x);
}
// We're done with this feed, so let's release some memory.
unset($feed);
}
// We need to sort the items by date with a user-defined sorting function. Since usort() won't accept "SimplePie::sort_items", we need to wrap it in a new function.
function sort_items($a, $b)
{
return SimplePie::sort_items($a, $b);
}
// Now we can sort $first_items with our custom sorting function.
usort($first_items, "sort_items");
$counter=0;
foreach($first_items as $item)
{
$feed = $item->get_feed();
$info = $userinfo[$item->feed->feed_url];
$counter++;
if($counter >= 10)
break;
if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.jpg'))
$avatar_field = '<img src="'.$pun_config['o_avatars_dir'].'/'.$id.'.jpg" alt="" />';
else
$avatar_field = '<img src="'.$pun_config['o_avatars_dir'].'/nopicture.png" alt="" />';
$picture = '<div id="feedpicture"><a href="member.php?id='.$user_id.'" title="'.$firstname.'\'s Member Page">'.$avatar_field.'</a></div>';
// Begin the (X)HTML page.
?>
<h3><?php echo $picture; ?><a href="<?php echo $item->get_permalink(); ?>" target="_blank"><?php echo html_entity_decode($item->get_title(), ENT_QUOTES, 'UTF-8'); ?></a></h3>
<!-- get_content() prefers full content over summaries -->
<? echo trim(substr((str_replace("\n", ' ', str_replace("\r", ' ', strip_tags($item->get_description())))),0,300)); ?>
... <i>more</i></a><br />
<p class="footnote"><a href="member.php?id=<?php echo $info['id']; ?>" title="<?php echo $info['firstname'].'\'s Member Page'; ?>"><?php echo $info['username']; ?></a> | <a href="<?php echo $feed->get_permalink(); ?>" target="_blank"><?php echo $feed->get_title(); ?></a> | <?php echo $item->get_date('M j, Y | g:i a'); ?></p><br />
<?php
}
?>
306 2008-01-04 18:36
Re: RSS feeds from database + associated data (skip NULL in MySQL output) (92 replies, posted in Programming)
I've sent a mail
307 2008-01-04 16:19
Re: FindClan.com (11 replies, posted in PunBB 1.2 show off)
The server seems a tad slow from time to time
308 2008-01-04 14:01
Re: float an image (11 replies, posted in PunBB 1.2 troubleshooting)
img { float: right; }
309 2008-01-04 02:48
Re: Detaching a function (5 replies, posted in Programming)
If your installation supports system() calls, yes.
system('php script.php &');
310 2008-01-03 23:55
Re: Who made the 1.3 design? (11 replies, posted in PunBB 1.2 discussion)
Paul.
311 2008-01-03 16:52
Re: RSS feeds from database + associated data (skip NULL in MySQL output) (92 replies, posted in Programming)
The while is still wrong.
312 2008-01-03 16:09
Re: RSS feeds from database + associated data (skip NULL in MySQL output) (92 replies, posted in Programming)
$query="SELECT id, firstname, username, rssfeed FROM members WHERE rssfeed!=''";
$result=mysql_query($query);
$feeds = array();
$id_array = array();
$first = array();
while ($cur_feed = mysql_fetch_assoc($result))
{
$feeds[] = $cur_feed['rssfeed'];
$id_array[] = $cur_feed['id'];
$first[] = $cur_feed['firstname'];
}
...
foreach ($feeds as $url)
{
$user_id = $id_array[$ix];
$ix++;
$firstname = $first[$ix];
$ix++;
...
313 2008-01-03 00:51
Re: IP question (5 replies, posted in General discussion)
Yes, you all have one IP, unless your internet traffic is channeled over multiple connections.
314 2008-01-03 00:34
Re: View Full Size "Resized" Image (24 replies, posted in PunBB 1.2 troubleshooting)
Just wait a bit until pastebin.ca comes back up and you'll have access to the correct code.
315 2008-01-02 15:39
Re: minor registration "bug" (4 replies, posted in PunBB 1.2 bug reports)
It isn't strange, it's just how the browser handles page caching.
316 2008-01-02 15:21
Re: RSS feeds from database + associated data (skip NULL in MySQL output) (92 replies, posted in Programming)
The code I've given should work providing you add the correct query.
317 2008-01-01 23:59
Re: RSS feeds from database + associated data (skip NULL in MySQL output) (92 replies, posted in Programming)
Well, that'd mean the array ($feed_array) is empty.
318 2008-01-01 23:18
Re: RSS feeds from database + associated data (skip NULL in MySQL output) (92 replies, posted in Programming)
$feed_array = array();
if ($db->num_rows($result))
{
while ($cur_feed = $db->fetch_assoc($result))
$feed_array[] = $cur_feed['rssfeed'];
}
$feed = new SimplePie($feed_array);
If that doesn't work, do a print_r() of $feed_array.
319 2008-01-01 22:25
Re: RSS feeds from database + associated data (skip NULL in MySQL output) (92 replies, posted in Programming)
No, it probably means you have allow_url_fopen off.
Does it work with other links?
320 2007-12-31 15:42
Re: VMware - Internet Connecting (2 replies, posted in Programming)
In VMWare, you can select the network type in the network card settings. Try NAT and Bridged, those usually work.
321 2007-12-31 14:45
Re: preg_replace() in C++ ? (3 replies, posted in Programming)
As I said on IRC.
http://www.pcre.org/
322 2007-12-31 14:44
Re: DB lookup question (6 replies, posted in Programming)
Whoops, I gave you the MySQLi one
For regular MySQL it would be:
mysql_data_seek($result, 0);
323 2007-12-31 01:04
Re: Rev 1206: _blank (13 replies, posted in PunBB 1.2 discussion)
It also means that every external link inside PunBB would be almost force opened in a new window for everyone, and that's just wrong behavior, that kind of thing should be controlled by the end user, not the software writer or the webmaster.
324 2007-12-31 01:02
Re: [1.3] New PHP URL rewrite system: localization (19 replies, posted in Feature requests)
It still won't work. I doubt a link full of special characters, which are translated to their ASCII/UTF-8 values, is clearer than obvious english words.