Jump to content

AncientSage

Members
  • Posts

    56
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

AncientSage's Achievements

Member

Member (2/5)

0

Reputation

  1. Possible, yes. ftp_connect(); http://us3.php.net/ftp_connect ftp_get(); http://us3.php.net/manual/en/function.ftp-get.php ftp_close(); http://us3.php.net/manual/en/function.ftp-close.php file_get_contents(); http://us2.php.net/function.file_get_contents Of course, you'll need to write it to a file, but you can unlink the file after you're done. Or just let it be overwritten each time. You can also create a file, connect to ftp, download file, write to that file, close ftp, then unlink the file after writting to a db. There are a few other functions needed, but those are a good portion of the ones that you can use. You can also read a file into an array using file();
  2. [code]Warning: implode() [function.implode]: Bad arguments. in /admincp/index.php on line 128[/code] There is my error. The line is as follows: [code]$vbulletin->GPC['navprefs'] = implode(',', $vbulletin->GPC['navprefs']);[/code] The implode function should be working, given that it is an official vBulletin release. However, there seems to be something wrong with it (PHP version IS above required by vBulletin). [code] $groups = explode(',', $vbulletin->GPC['groups']); foreach ($groups AS $group) { if (empty($group)) { continue; } $vbulletin->input->clean_gpc('r', "num$group", TYPE_UINT); for ($i = 0; $i < $vbulletin->GPC["num$group"]; $i++) { $vbulletin->GPC['navprefs'][] = $group . "_$i"; } } $vbulletin->GPC['navprefs'] = implode(',', $vbulletin->GPC['navprefs']);[/code] Help appreciated.
  3. Meh, I suck with the where clause. >_> Yeah, I intend to add some error checks here soon enough, hopefully I'll be able to comprehend the errors better then. Thanks for the help.
  4. Currently, I'm working on a forum script, using PEAR DBAL. The error I get is in the title, the code works fine in any other file, except this one. So I would guess it's code problems, the code: [code]      $sql = "SELECT id, name FROM threads WHERE forum = " . '$id';       $result = $dbh->query($sql);       $topics = array();       while($row = $result->fetchRow(DB_FETCHMODE_ASSOC))       {       $topics[] = $row;       }      [/code] However, I don't see anything wrong with it...it's working on my index.php page, which is built the same, except this one has an if statement surrounding it. Possibly a query problem?
  5. Cancel that... Seems I needed to set a mode for fetchRow(DB_FETCHMODE_OBJECT). Then foreach through the rows.
  6. Currently, I'm messing around with DBAL (Database Abstraction Layer), so I can't use MySQL functions and such. Anyway, I have this: [code] $sql = "SELECT id, name, info FROM forums"; $result = $dbh->query($sql); $forums = array(); while($row = $result->fetchRow()) { $forums[] = $row; } [/code] 'k, that works. Now, I don't want to access the id field by going like this: $forums[0][0] ...which returns the first row and the first field. I want to be able to go and do this: $forums[id] However, I'm not sure if it's possible or not, and again, I'm using a DBAL. Thanks.
  7. Server specs: [code]cPanel 10.8.2-S120 Apache 1.3.37 Spam Assasin 3.1 phpMyAdmin 2.8.0.2 PHP 5.1.6 PERL 5.8.7 MySQL 5.0.24-standard Processor Name: AMD Opteron 170 [2GHz] (Dual core) Operating System: CentOS 4.4 i686 Memory Information: ECC Registered 1024 MB RAM[/code] The server load is usually around 0.1 through 0.8, I know I have a ton of mods on the forum, I'll probably be ditching quite a few on a switch to phpBB3. And thanks, I'll look into SMF, I'll just need to find out how to add on to them and such, though.
  8. Trying to find a forum software that is fast in the way of server-sided scripts, however, I'm having a hard time doing so. I don't want to pay for the software, but I don't want slow software either. Currently using phpBB 2.21, however, it's slow with how many modifications are on it. Luckly phpBB 3 seems a bit faster than my current version of phpBB 2.21. So yeah, what is the fastest GNU forum with a good variety of features?
  9. I always miss something so simple. >.< Anyway, thanks for the help.
  10. I'm attempting to use this query via PHP: [code]"SELECT song_name, song_author, song_genre  FROM jukebox WHERE " . $song_selected . " = song_filename"; //Note, this line.[/code] All good up 'till that last line, I tried switching it around (where the variable is) and such, but it keeps telling me unknown column, or SQL Error 1054. Now, I'm not too familiar with the WHERE clause, but if I want to tell SQL only to select results based on a row in song_filename, how would I do that with the WHERE clause? 'cause my method doesn't appear to be working.
  11. Thanks, that works. I wasn't sure if GET vars could be passed via an image. However, rather than make it call to an undefined function, I put the check around the function call, and let the function be defined.
  12. Hello, If I create an image, using this script: [code] function dbar($status) {   $bar = ImageCreate(100, 5);   $red = ImageColorAllocate($bar, 255, 0, 0);   $green = ImageColorAllocate($bar, 0, 255, 0);   ImageFilledRectangle($bar, 0, 0, $status, 4, $green);     header("Content-type: image/png");   ImagePng($bar);   ImageDestroy($bar); } $status = '10'; //Ignore the status var... dbar($status); [/code] Then, I go and save it to a php file, is it possible, instead of saving it into a seperate file, and then including it into an <img> tag, that I could have it included via an HTTP var? Like... <img src="script.php?img=phpimage"> Instead of... <img src="image.php"> That way, I am able to get the $status var (as it will be defined by a database, probably). But the image is only displayed if included in an <img> tag as script.php?img=phpimage. Thanks.
  13. Yup, I do. And I should note it's a linux server, so .dll won't be found.
  14. First, I know my code is fine, I ran it on another server. But when I switched the server, I'm getting an error trying to use ImageCreate(), the paths and such are defined, but the function just isn't working. Could anyone tell me what to do about it? I'm guessing it involves editing of the php.ini file.
  15. Meh. So there is no easier way to force it to use names instead of numbers when drawing from a database? Then I guess I'll have to make sure I do this all very carefully.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.