76

(5 replies, posted in PunBB 1.2 troubleshooting)

What paul just mentioned above is applicable to all web brwosers if configured in certain ways.

Ignore this next part if you upload your forums. If your hosting the website from your own computer, you want to link to php-cgi binary. The php binary doesn't handle post or get data.

77

(16 replies, posted in General discussion)

naitkris wrote:

i am almost scared of 1.3, i hope it is released later rather than sooner as i have mod'd a PunBB 1.2.14 i am working on a lot. i think the changes will cause a lot of time to upgrade for me sad

As am I... I'm not sure if I should start coding a "Mod installer" plugin for 1.2, or a "Best guess mod converter" for 1.3 XD I think the best guess would be the most loved, but it would probably be released around the time punbb 2.9 is tongue (and it have bugs tongue)

78

(4 replies, posted in Programming)

function insertHtmlButton (id) {
  var addafter = document.getObjectById(id);
  addafter.innerHTML = addafter.innerHTML + '<a href="javascript:toswap(\'plom2\');">Hide/Unhide blabla</a>';
}

That will insert code after said id. I always use IDs but I think there's a way to access classes. Keep in mind the page has to "exist" before the function is called. If you call this code in the header (before the body and the id in question is parsed), then nothing will happend.

in include/parser.php line 383ish there's probably a missing ";" <-- end of line of code char. I can only guess though, post a copy of your parser.php, but only like 2 or so lines above and below 383.

80

(5 replies, posted in PunBB 1.2 troubleshooting)

Upgrade to firefox?

Ok, ok... lol, had to be said tongue Can you be more detailed? what mods you have on your forum? what type of not login is it? the "login button does show up" kind? the "login form is filled out but doesn't submit" kind? another kind?

81

(6 replies, posted in Programming)

Erm... name it? For starters, I could actually use something that resembles perl regex tongue Array handling. Doing RLE on  data to "bypass" the memory limits of php.

php is a great tool to make a counter on your website, It's not a great tool to handle any amount of data larger then the average e-mail (without attachments tongue).

82

(7 replies, posted in General discussion)

zaher wrote:

I remember old juke about poor man smelled a meat roast and take (eat) a bread with the smelling, the Man butcher catch him and ask to pay, the poor man can not pay for smelling so he get a some of coins and make clank with it and say to butcher "listen to this is clank voice and take it (the voice) as a paid for the smelling".

hehe, That's a great one big_smile I'm going to have to steal that story and tell all my friends smile

83

(13 replies, posted in PunBB 1.2 discussion)

Meh, we all do it, infact I just seen a topic on some punbb code that is invalid xhtml when a user doesn't have an avatar (or something like that...).

I would suggest the DevBlog discussion involves what extra information is needed in the mod/extention headers. You can't stop someone from (not)? caring. You can't stop someone from caring and messing up once in a while. But you can tell people if you care or not big_smile In many cases it's impossible to verify the xhtml unless you have some sort of client side validator.

84

(4 replies, posted in Programming)

<h3 id="topH">some header</h3>
<ul id="plom" class="plom">
<li id="plom1">blabla</li>
<li id="plom2">blabla</li>
</ul>
<p id="bottomP">some text</p>
<p><a href="javascript:swap('topH');">swapH</a></p>
<script language="javascript"><!--
function swap(id) {
  var toswap = document.getObjectById(id);
  if (toswap.style.display != 'hidden')
  { toswap.style.display = 'hidden' }
  else
  { toswap.style.display = 'block' }
}
--></script>

Not sure if it's block or hidden, just do some searching for the tags on the css display tag. This jscript is murder when used on tables though, in IE, firefox and opera you tend to get a table that grows in an ugly way when using this on a tr or a td.

85

(6 replies, posted in Programming)

Yah, I've perty much given up on the preg set from php... The comparison code I'm using now is what you'd expect to see in C code. Using things like ($str[0] == 'c') for the most part. php's string handling functions are so darned weak ;.; They should just give us raw access to pointers, so we can actually write efficient code XD

86

(11 replies, posted in General discussion)

I would love a Wii, don't want the box with it though tongue computer > console. You can get 90% of the good games released on console on the computer, and 1-3 years after the release of any console you can emulate any game on the pc tongue

The Wii is friken accurate though. My friend brought one to a get together, with this "operation" game. If the Wii had a star-trek type lazer on it, you could trim your nails with it!

if you want to add something yourself, to every page in a side menu, start by copy and pasting the theme selection from the profile.php code. I would start by making a theme.php page, and then on the side menu, forward the theme selection form to theme.php and redirect the user back to whatever page they were at once theme.php handles the request. misc.php has some code in it that forwards you back to whatever page you were at.

Hope this helps. I havn't seen a mod like this though.

88

(8 replies, posted in Programming)

Meh, i was just trying to think up excuses, to sound smart big_smile

either way though, files are the way to store files, not databases XD

89

(3 replies, posted in General discussion)

Not sure about miniportal... the "front page" mod I use needs you to set the option in the actual file though (index.php). Somewhere near the top. miniportal might have an admin panel configuration though.

90

(8 replies, posted in Programming)

if you database was sqlite you might have to, I can't remember atm but i think there's only number and string data types. Also, as string, you could perform string based searches for the file type from the files header. Many file types have the first 2-4 bytes as chars specifying their format.

Try this on your "test forum"

1) install 1.0.1
2) make test posts and users and test the forum
3) upload only the 10_to_11_update.php
4) run the script
5) upload only the 11_to_12_update.php, etc... until you get to 1.2.14
6) upload the files/directories in the upload directory in the punbb 1.2.14 installer
7) Change file permissions as described in the 1.2.14 install directions
8) make test posts and users and test the forum

just pass variables you need in the argvs to the perl script.
Humm, you probably could use a tmp file or two, or three for input/output/errors between the php script and the perl script tongue

93

(8 replies, posted in Programming)

Couldn't you use a string type too, and escape the binary data? dono what the limits on string types are in mysql though tongue

94

(7 replies, posted in General discussion)

zaher wrote:

Some one must talk about "Open Music" instead of "Open Source", and release music with GPL License tongue

The rules on my forum (where I post music made by my "band", we couldn't play a song if our life depended on it, but it is public licenced music.)

https://robshouse.no-ip.info wrote:

Here's the rules:

1) What the administrators or moderators say is law!
2) Stay on topic
3) Don't be stupid
4) Have fun big_smile
5) You are not alloud to upload any copyrighted music

There is only one exceptions to rule 5:

- You are the copyright holder(s) (ie: You own the rights to the copyright).
- You(s) disclaims any ownership to the music that is uploaded.
- Any music upload is understood to be public licence, under the terms of the blessing below

    The author(s) disclaims copyright to this material.

    In place of a legal notice, here is a blessing:
   
    May you do good and not evil.
    May you find forgiveness for yourself and forgive others.
    May you share freely, never taking more than you give.

You can normally find that same blessing in tutorial code. Some open source projects might even come under that licence (I believe there's an official name for that blessing, forget it though... shows up for some gentoo e-build though, afaik).

Originally this was the idea behind the hippy days of the 60s in the US, where popular artists would regularly share and "borrow" lyrics, guitar riffs, etc... Nowadays popular artists will sue children for downloading songs X.X I've even hurd of a case where someone wrote a song, which his label became owner of. Later in his career, with the same label, he released another song, and was sued by the company that employs him, because it sounded to much like the other song, that he wrote... XD (It's one of the guys from "dire straights" if you feel like browsing the internet for more info).

On the same subject of open source... where's the public licenced designs for cars, and computer hardware? and microwaves? and TVs? and airplanes? We've all been a part of the 1500th century market for too long, where the invisible hand of market forces turn greed into benevolent actions by companies. We know that isn't true, so let's all do something about. I'm trying to do my part, with my junky public licenced music big_smile

95

(2 replies, posted in PunBB 1.2 troubleshooting)

That data is stored on the database... I'm sure there's a user management related mod/plugin that let's you send an e-mail to all users (if that's what you want). If your talking about making your own mod, the just list the e-mails stored in the users table. If your looking for an easy way, search punres for a user management mod. I remeber hearing about 1 or 2 that let you send off e-mails to all registered users... forget what they were called though tongue

PS: In a "vanilla" or original punbb install you have to click on each user in the user list, and then in thier profile you can see the info (if your an admin, I think if your a mod too?)

96

(7 replies, posted in General discussion)

I believe any good music must be free for all big_smile
Many recent, and older popular "Western" (including some/most? europe) music bands have been screwed over by the corperations owning the music industry. Buying CDs is money for the corperations. Support music by going to concerts instead tongue And support your local bands, go to the local pub and pay that $5 cover to see the guy/girl, who normally servers you coffee all week long, play some music that one day a week big_smile

BTW, not my style of music, but I like it anywho big_smile she's got a great voice smile

Ok... AMP_PassData2CgiAndPrintCgiResult.cgi

<?php
/***********************************************************************

  Copyright (C) 2002-2007  Punbb Community (deadram at gmail dot com)

  This file is part of 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

************************************************************************/

// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
    exit;

// Tell admin_loader.php that this is indeed a plugin and that it is loaded
define('PUN_PLUGIN_LOADED', 1);

//
// The rest is up to you!
//

// Display the admin navigation menu
generate_admin_menu($plugin);

?>
    <div class="blockform">
        <h2><span>A test plugin</span></h2>
        <div class="box">
            <form method="post" action="<?php echo $_SERVER['REQUEST_URI'] ?>">
                <p class="submittop"><input type="submit" name="run_cgi" value="Run" /></p>
                <div class="infldset">
                    <fieldset>
                        <legend>Options</legend>
                        <div class="infldset">
                            <table class="aligntop" cellspacing="0">
                                <tr>
                                    <th scope="row">Run cgi</th>
                                    <td>
                                        <input type="text" name="cgi_path" value="./plugins/cgi/SomeCgiScript.cgi">
                                        <p>Type the relative path from the forum root directory to a cgi script above</p>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </fieldset>
                </div>
                <p class="submittop"><input type="submit" name="run_cgi" value="Run" /></p>
            </form>
        </div>
    </div>
    <div class="blockform">
        <h2><span>Output</span></h2>
        <div class="box">
            <p><?php if (isset($_POST['run_cgi'])) { passthru($_POST['cgi_path'].' ARGVARS FROM PHP IE: data from the user table, ect...'); } ?></p>
        </div>
    </div>

SomeCgiScript.cgi

#!/usr/bin/perl

$numArgs = $#ARGV + 1;
print 'Thanks, you gave me '.$numArgs.' command-line arguments.'."\n\n";
foreach $argnum (0 .. $#ARGV) {
    print "$ARGV[$argnum]\n";
}

print "\n\n".'Here\'s your environment variables:'."\n\n";
foreach $key (sort keys(%ENV)) {
    print "$key = $ENV{$key}\n";
}

In the php script get whatever data you need. Stuff for the database, etc... in perl parse the argvars.
The cookie set by punbb is just a number that references a row in the punbb database, that has I think uid, ip, cookie "id", and accesstime. I forget exactly though. You don't need to fumble around with the cookie though. in the php script get the vars you want to change and/or alter. in perl do the work, and in php parse the output and change any values.

The php's official docs on passthru list a few alternative ways to call external applications.

If you wanted to use the example above and then access the database in the perl script, you will need to write your own database access code ($db->Function isn't official php, it's punbb's own db layer). Give me a few and I'll edit to include some info on the database records tongue

EDIT --

Looks like I was wrong. Guess the cookie doesn't work like I expected it too. Anyways, you don't need the cookie, if you already have the uid tongue

98

(6 replies, posted in Programming)

code:

if (preg_match('/^diff -urN punbb_vanilla\/(.*) punbb_____mod\/\1$/', $diff_urN[$dln]))
{
    # Grab the filename
    $fname = ${1};
    print '$fname:'.$fname;
} else print 'I love perl... but I #$@% php regex';

output:

$fname:

What am I doing wrong here? please don't tell me I have to use the match array X.X Anyone even know why they call it a perl compatible regex? Couldn't be further from the truth... tongue

99

(1 replies, posted in PunBB 1.2 troubleshooting)

Just incase you rename the file:

<form blah action="<?php echo $_SERVER['REQUEST_URI'] ?>">
$filename = $dir . "./lists/" . $name . ".lst"; // $filename = "./lists./lists/".$name.".lst" remove that static "./lists/" :P
//path of lists directory, absolute or relative to this script
$listdir = "./lists/";
//chdir($listdir);
//get list names
$lists = glob("*.lst"); // Maybe you want glob($listdir."*.lst")
  $name = preg_replace("./.lst$/", "", $list); // try preg_replace('/^(.*)\.lst$/', '${1}', $list)

And

print_r($_POST);
exit();

is great for debugging forms big_smile

100

(13 replies, posted in PunBB 1.2 discussion)

My next MDT version will include a

##  XHTML validated:  Yes/No/Should be (Unvalidated)

in the readme header. Should be is for people like me, who try to, but often forget to close an input with />, or what not tongue