shot in the dark...

do you have an invalid reference in the my.cnf file?  what's your basedir?

[mysql.server]
user=mysql
basedir=/opt/lampp/var/mysql
elbekko wrote:

Are you trying to use MySQL or MySQLi?

ah, sorry i misunderstood.  he's already got punbb up and trying to install...

yeah elbekko's right.

what's the error punbb is giving you?  or are you just not sure what to tell punbb?

xampp on linux = tits on a bull

ok.  what is your problem?  you have xampp installed?  now drop punbb in the proper directory and i think everything will 'just work'.  but this is a terrible install and should not be used for anything but playing around.  if you let outside visitors in you will get owned!

here's some neat info on xampp:

A few helpful notes:

    * You'll find php.ini and httpd.conf files in the /opt/lampp/etc directory
    * Web pages go in the /opt/lampp/htdocs directory (the DocumentRoot)
    * Make sure that previously installed Apache/MySQL services, etc. are stopped
    * Default installation of XAMPP is "wide open", i.e., MySQL has no root password.
    * There's an easy way to handle security settings by running "/opt/lampp/lampp security". Again, note the spaces between the words.

You'll find additional information on XAMPP at http://www.apachefriends.org.

from http://www.nyphp.org/phundamentals/xampp.php

also mysql makes some very nice gui's you may want to check out http://www.mysql.com/products/tools/

if you're going to use linux do stuff like a linux user.  install the packages and learn how they work.  it's really not that hard.  i bet when you installed your distro you could have had apache / mysql / php installed for you.  no need for xampp.  check out your distros documentation.  i would bet $1,000,000,000 there's a lot of information on how to set this up.  if for some crazy reason you insist upon using xampp then read their documentation.

you can do it.

no offense to xampp or anybody else, but if you're going to use linux use yum or what ever package manager your distro uses and then read the documentation.

if you use fedora, use pup (gui) or yum.
yum -y install httpd php mysql mysql-server php-mysql

read http://dev.mysql.com/doc/refman/5.1/en/index.html and http://httpd.apache.org/docs/ or http://www.google.com/search?hl=en& … tnG=Search

there's a ton of information.

32

(8 replies, posted in PunBB 1.2 show off)

very good job.  wordpress and punbb.  nice colors.  i like it.

33

(3 replies, posted in Programming)

i figured it out.  there's whitespace somewhere.  trim($name) fixes it.  :s

34

(3 replies, posted in Programming)

hi.  echo gives no clues.  no unwanted characters.  it works if i substitute numbers but not "yes" or "no".  odd...

#!C:\php\php.exe
<?php

/* why doesn't this work on winxp?  it always goes to the default case. */

echo "\nAre you going to write some cool scripts?\n";
$name = fread(STDIN, 1024);
switch ($name) {
    case "yes":
        echo "\nHa, you can't even get this working!";
        break;
    case "no":
        echo "\nWhat are you, lazy?";
        break;
    default:
        echo "\nYes or no please.";
    }
sleep(2);
echo "\n$name";
sleep(2);
?>

35

(3 replies, posted in Programming)

hi.

#!C:\php\php.exe
<?php

/* why doesn't this work on winxp?  it always goes to the default case. */

echo "\nAre you going to write some cool scripts?\n";
$name = fread(STDIN, 1024);
switch ($name) {
    case "yes":
        echo "\nHa, you can't even get this working!";
        break;
    case "no":
        echo "\nWhat are you, lazy?";
        break;
    default:
        echo "\nYes or no please.";
    }
sleep(2);
?>

thanks.

36

(3 replies, posted in General discussion)

hi idunno, if you're in the mood, tell us more.  thanks.  eric.

37

(3 replies, posted in Programming)

Jérémie wrote:

I don't mean to be rude, but 100 USD for ?I want it to blow my freakin' socks off.  it should look completely different from anything done for punbb in the past.  a theme that does this kick ass code justice.? is out of the question.

thought 1:  the amount of money is small.  good point.  but it's the most i can afford to offer.  since there are a number of commercial websites that benefit from punbb i invite them to join me and sweeten the prize.  more developers would be encouraged i'm sure if it was $500 or (i wish) $1,000.  so i hear what you're saying, but we must start somewhere.  i offer what i have.  it's understandable if you desire not to participate and i'm sure a professional designer feels the same.  (he'd really have to love punbb to take time away from some high paying client!)

thought 2:  most people hacking on punbb are probably students and hobbyists.  my mods aren't for cash, they're for fun.  i figure their themes are of similar motivation.  so if we could get a couple budding bad ass designers to submit something the entire punbb community will benefit.

thought 3:  my wording of "..blow my freakin' socks off.." is merely an attempt to get people to think outside the box and not just taking an old theme and changing a color.

you're not rude.  i value your opinion (you've been a community member much longer than i). 

thanks.

38

(3 replies, posted in Programming)

hi all.  i'm trying to start up a theme design contest.  check out http://www.punres.org/viewtopic.php?id=3827 for more info.

i hate to cross post but i wanted to get the word out here at the official punbb website

##        Mod title:  puntracker
##
##      Mod version:  1.0.4
##   Works on PunBB:  1.2.15
##     Release date:  2007-08-14
##           Author:  eric235u (support@newmag.org)
##
##      Description:  a bittorrent indexer
##
##   Affected files:  only included files
##
##       Affects DB:  yes.  adds a table.
##
##          Changes:  punscrape.php is called within in image so users don't
##                    have to wait for the scrape to be preformed.  (thanks
##                    Smartys for the idea!)
##                    added thepiratebay search form.
##                    changed scrape interval.
##
##            Notes:  (1) requires PHP/CURL.
##                    (2) if you want to use the 'scrape'
##                    feature make sure you're using a tracker that
##                    supports it.  not all trackers do.  also, for torrents
##                    you list with this module but do not scrape, you will
##                    have to independently verify whether or not the
##                    torrent is active.  such as with your bittorrent
##                    client.
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##

it's a little better than the former version.  it's worth upgrading if you're using 1.0.3.  bug hunting welcome!  hope the community likes it.  thanks.

here's an example installation:
http://newmag.org/forum/puntracker.php

here's the download:
http://www.punres.org/files.php?pid=399

40

(6 replies, posted in Programming)

that works great!  cool.  thanks man.

example:  http://newmag.org/forum/puntracker.php

41

(6 replies, posted in Programming)

ah crap.  no 'Program Execution Functions' are supported.  too bad.  your suggestion of exec would have worked perfectly.

I would make the script display a 1x1 transparent image and call the script in an image tag at the bottom of the page.

mmmnnn....  i've never done something like that before.  i'll do a little reading.  thanks.

42

(6 replies, posted in Programming)

my mistake.  i assumed you did it on purpose and was just fooling around.

thanks again for the php tip.  i'm going to work on it today.

43

(6 replies, posted in Programming)

exec, that's a neat idea.  i'll see if my host has that function.

p.s. - what the f* is that?  // the link that was here has been removed.

although i have not integrated wordpress i've seen others who have (quaker if remember correctly).  i would suggest posting your exact error messages and methodically fixing them.  (^.^)

hi all.  i have a bittorrent scrape object on one page.  i then, require PUN_ROOT.'punscrape.php';, at the top of my index page.  so when a visitor goes to my index page the bittorrent tracker is scraped via libcurl.  the problem occurs when a tracker times out or is just slow to respond.  this problem is even worse when i have several torrents on several trackers that are slow to respond to my scrape request.  so...

how the heck to i run my scrape object after the users visits index?  this is a manged website and i don't have access to cron.  thanks for any tips!

just for amusement, here's my scrape page code.  it's a little noobish, but it functions.

<?php

/*

  This file isn't part of PunBB.  This file is part of 'puntracker'
  a bittorrent indexer modification for PunBB.

  PunBB 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.

  PunBB 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., 59 Temple Place, Suite 330, Boston,
  MA  02111-1307  USA

*/

// let's keep tracker within punbb
define('PUN_ROOT', './');
require_once PUN_ROOT.'include/common.php';

// comment out after debugging
// error_reporting(E_ALL);

// the scrape object
class punscrape
{
    function do_scrape()
    {

    global $db;
    
/* for debugging purposes.  comment out.
    global $complete;
    global $downloads;
    global $incomplete;
    global $matches_complete;
    global $matches_downloaded;
    global $matches_incomplete;
    global $scrape_result;
    global $scrape_url;
    global $result1;
    global $cerror;
*/
    
// let's check if the torrent(s) need(s) to be scraped. (1.5 hours)
$table = $db->prefix.'puntracker';
$result1 = $db->query("SELECT announce FROM $table 
WHERE $table.last_scrape <= NOW() - INTERVAL 1.5 HOUR");

while ($row = $db->fetch_assoc($result1)) {

// if query returns a row, scrape url
    if (isset($row['announce'])) {

$scrape_url=$row['announce'];

// create a new cURL resource
$ch = curl_init();

// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, $scrape_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);  // to return text
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 6);  // at higher values i get "PHP Fatal error:  Allowed memory size of 20971520 bytes exhausted".  you may want to adjust these values for your own needs.
curl_setopt($ch, CURLOPT_TIMEOUT, 10);

// grab URL text and set $scrape_result
$scrape_result = curl_exec($ch);

// for debugging. comment out.
$cerror = curl_error ( $ch );

// close cURL resource, and free up system resources
curl_close($ch);

switch (isset($scrape_result)) {
case TRUE:

// let's extract complete (seeds), downloaded and incomplete (peers).
preg_match("<completei\d*>", $scrape_result, $matches_complete);
preg_match("<downloadedi\d*>", $scrape_result, $matches_downloaded);
preg_match("<incompletei\d*>", $scrape_result, $matches_incomplete);

$matches_complete = implode($matches_complete);
$matches_downloaded = implode($matches_downloaded);
$matches_incomplete = implode($matches_incomplete);

$complete = ltrim($matches_complete, "completei");
$downloads = ltrim($matches_downloaded, "downloadedi");
$incomplete = ltrim($matches_incomplete, "incompletei");

// if scrape returns text update mysql
if (is_numeric($complete)) {

$complete=mysql_real_escape_string($complete);
$downloads=mysql_real_escape_string($downloads);
$incomplete=mysql_real_escape_string($incomplete);

//  update mysql.
$table = $db->prefix.'puntracker';
$query = "UPDATE $table";
$query .= " SET complete = $complete, downloads = $downloads, incomplete = $incomplete, last_scrape = NOW()";
$query .= " WHERE announce = '$scrape_url'";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());

}
    break;
    
case FALSE:
    break;
}

    }}

}}

// let's run punscrape.php
$updatedb = new punscrape;
$updatedb->do_scrape();

?>
##
##
##        Mod title:  Links Plus
##
##      Mod version:  2.4
##   Works on PunBB:  1.2.15
##     Release date:  2007-08-08
##           Author:  eric235u (support@newmag.org)
##
##      Description:  This is a mod to display web links with categories,
##                    descriptions and hits in a user friendly format.
##
##   Affected files:  None.
##
##       Affects DB:  Yes.
##
##            Notes:  Requires MySQL.
##
##          Changes:  Added hits and date field.
##                    Added top 10 and recent 10.
##                    Added hit counter.
##                    Minor style changes.
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##

punres link here:
http://www.punres.org/files.php?pid=413

example installation here:
http://newmag.org/forum/linksplus.php

all bug submissions welcome.  hope you find the module useful.

yeah it seems get is the way to go.  thanks for the tips guys.

i've tested the new mod out on two sites and it seems to work.

:-)

hi all.  i'm redoing my web links module so that it will keep track of the day a link was submitted and how many times a user has clicked on a link.  on the links page i list the 10 newest links and the ten most popular links.

the new module looks very cool and i think people are going to like it.  what do you think is the best method to keep track of hits?  i have an int column called hits.  every time a user clicks on a link to example.com, i want that row's 'hits' cell increased by 1.  my first thought was to make it like a form and use post to pass the information, but this seems kind of clumsy.  so i thought why not ask the community before i finish that part.

thanks for any tips.

looks good.

take your ftp client and download all the files from server 1.

make a back up of your database.  i would do this with phpmyadmin.  your situation may be different.

take your ftp client and upload all the files to server 2.

edit your config.php to reflect new password and other variables if needed.

load the sql file from db1 to db2.

go to index.php and smile.

i may have skipped a thing or two.  this is off the top of my head, but it's really easy to do.