<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[FluxBB.org Forums]]></title>
		<link>http://fluxbb.org/forums/</link>
		<description><![CDATA[The most recent topics at FluxBB.org Forums.]]></description>
		<lastBuildDate>Mon, 05 Jan 2009 14:04:59 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[PHP variable scope]]></title>
			<link>http://fluxbb.org/forums/topic/2435/php-variable-scope/new/posts/</link>
			<description><![CDATA[I've been developing a simple PHP framework to help teach me to use OOP in PHP more. 

The [url=http://git.georgemh.com/?p=ezphp.git;a=summary]EzPHP[/url] framework essentially works by using mod_rewrite to dump the entire URL into a single php script. The script will then modify any default settings and initialize EzPHP. EzPHP will parse the URL and look for a module to load to handle the request. If there is no module found, and the URL resolves to a real file on the disk, there is a FileHandler module designed to either output the file, or execute it if its a PHP script.

I am trying to get FluxBB to run under the FileHandler module. The most relevant code is this:

[code]
    public function outputFile($file){
        $req = $this->req;
        
        if($this->filterFile($file))
            throw new NotFoundException();
        
        $type = $this->getMimeType($file);
        
        if($type == 'application/x-httpd-php-source'){
            highlight_file($file);
        }elseif($type == 'application/x-httpd-php' && $req->getConfig('FILEHANDLER_EXECUTE_PHP_SCRIPTS')){
            chdir(dirname($file));
            require($file);
        }else{
            header('Content-Type: '.$type);
            readfile($file);
        }
        $req->exitCleanly();
    }
[/code]
If the file to be executed is a PHP script, it will "require" it, so it gets executed. The chdir changes the directory to the parent directory of the file being executed. My problem is that in FluxBB, most of the functions use the global keyword to access some variables, but they aren't in the same scope as what global implies, they are in the scope of the outputFile function, so fluxbb fails to execute. The error is this:

[code]
Fatal error: Call to a member function query() on a non-object in /home/george/public_html/dev/stayanon/forums/include/functions.php on line 125
[/code]
$db is set to null because it has the wrong scope, and isn't really a global function any more. 

Another odd thing is that index.php works just fine when executed under the FileHandler module, but none of the other pages do.

You can see what I mean by going here:
Username: fluxbb
Password: fluxpassword1

[url]http://fluxbb:fluxpassword1@home.georgemh.com/~george/dev/stayanon/forums/index.php[/url] Works
[url]http://fluxbb:fluxpassword1@home.georgemh.com/~george/dev/stayanon/forums/login.php[/url] Doesn't work

If anything, none of the fluxbb pages should work due to the variable scope problem, but somehow index.php does work, but none of the others do. 

A more complete paste of the code can be found here: [url]http://pastebin.com/f27045543[/url]
You can view the full EzPHP framework here: [url]http://git.georgemh.com/?p=ezphp.git;a=summary[/url]

Much appreciated if anyone has any insight into this. If you have questions don't hesitate to ask.]]></description>
			<author><![CDATA[george@georgemh.com (Ruckus)]]></author>
			<pubDate>Mon, 05 Jan 2009 14:04:59 +0000</pubDate>
			<guid>http://fluxbb.org/forums/topic/2435/php-variable-scope/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Fallback localization?]]></title>
			<link>http://fluxbb.org/forums/topic/2406/fallback-localization/new/posts/</link>
			<description><![CDATA[There is a problem with localization files being used, that when it is about to be a new version, one should manually look up for differences in localization files, or else it would not even work. It would be great, if there were a fallback to English for strings not found in a specific localization file. It could be done through using a function instead of arrays everywhere localized strings are used, e. g. "forum_lang('common', 'No view')" instead of "$lang_common['No view']". I hope I was not too obscure in my wish. Sorry for my bad English.]]></description>
			<author><![CDATA[dummy@example.com (Frank H)]]></author>
			<pubDate>Mon, 29 Dec 2008 22:38:10 +0000</pubDate>
			<guid>http://fluxbb.org/forums/topic/2406/fallback-localization/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[How create an extension for FluxBB 1.3 ? Didn't find the doc]]></title>
			<link>http://fluxbb.org/forums/topic/2398/how-create-an-extension-for-fluxbb-13-didnt-find-the-doc/new/posts/</link>
			<description><![CDATA[Hi all members,

I'm new on this forum and I would develope an extension for FluxBB 1.3. I have a local forum where this version is installed.
I have already search on Google and in the two research motor ( fluxbb.org & fluxbb.fr ) but I didn't find anything.

Can you help me with a link please ? I want realy know how the new "one click install management" works.
For example I want to develop a video bbcode with arguments : [video=youtube][url]http://www.youtube.fr[/url]?etcetcetc...[/video] or [video=dailymotion][url]http://www.dailymotion.fr[/url]?etcetcetc...[/video]

I know that this extension exist for 1.2 and maybe for 1.3 but I want develop this by myself ^^

Sorry for my bad english I'm a french student.
Thank to you and good continuance ^^]]></description>
			<author><![CDATA[dummy@example.com (Dimitri)]]></author>
			<pubDate>Sun, 28 Dec 2008 04:03:39 +0000</pubDate>
			<guid>http://fluxbb.org/forums/topic/2398/how-create-an-extension-for-fluxbb-13-didnt-find-the-doc/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[list-style-type:decimal and <ol> in IE7]]></title>
			<link>http://fluxbb.org/forums/topic/2381/liststyletypedecimal-and-ol-in-ie7/new/posts/</link>
			<description><![CDATA[is it just me or does list-style-type:decimal and <ol> not work in IE7?]]></description>
			<author><![CDATA[dummy@example.com (elbekko)]]></author>
			<pubDate>Tue, 23 Dec 2008 14:56:56 +0000</pubDate>
			<guid>http://fluxbb.org/forums/topic/2381/liststyletypedecimal-and-ol-in-ie7/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Pictures not showing up]]></title>
			<link>http://fluxbb.org/forums/topic/2244/pictures-not-showing-up/new/posts/</link>
			<description><![CDATA[Hey, can anyone point me into the right direction with this? The pictures are not showing up... why?

[url]http://www.vsgunion75.de[/url]]]></description>
			<author><![CDATA[dummy@example.com (Connor)]]></author>
			<pubDate>Sun, 07 Dec 2008 13:32:03 +0000</pubDate>
			<guid>http://fluxbb.org/forums/topic/2244/pictures-not-showing-up/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[SQL Query Help Needed - UserList Related...]]></title>
			<link>http://fluxbb.org/forums/topic/2312/sql-query-help-needed-userlist-related/new/posts/</link>
			<description><![CDATA[Hi All,
I know a lot of us need to keep hiking 1.2 up a little.  Practically speaking many of us won't be able to migrate a complex BB over for some time, even if we were showering in 1.3 months ago.    I have run into my userbase screaming for upgrades, and I have to deliver.....

Just to be clear - I ain't complaining - I am so happy with FluxBB1.2.20.  Its like a good old Ford Truck (or a Scout 4WD - my fav), takes a lickin' and keeps on keepin on... and I am very grateful to you coders, and support your hard work.

---------------------------------------------------------------------------------------------------------------
PURPOSE HERE: Obtain some help sussing a decent logical approach to a needed query.
---------------------------------------------------------------------------------------------------------------
I have been working on the multigroup mod from noof at punres... got it working tamely now, and making some improvements, including integration with the SubForum Mod ;^) 

***I am focussed right now on the userlist.php file with consideration to where the userslist is displaying the user's group Title (I'll refer to that as the title-cell for now).

[b]With the mod installed I want to have this "title-cell" present a comma delimited list of 'g.group_user_titles' the user is a member of.
I have somethings worked out in that direction, but I could use a little help.[/b]

SPECIFICS
***I am looking for some pointers on 
 - how to get groups:g_user_title 
 - upon matching a custom value in the users:membergroupids 
    (its a new column - lets forget for the moment it holds an array if need be - until and unless I get some other basics down) 
 - where the value in users:membergroupids matches group:g_id.

HERE IS THE CODE I AM TWEAKING..............
[b] 1) In userlist.php ~LN 191 under 'grab the users'...........[/b]
is this slightly modified Select Statement:[code]
SELECT u.id, u.username, u.title, u.membergroupids, u.num_posts, u.registered, g.g_id, g.g_user_title 
FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id 
WHERE u.id>1'.(!empty($where_sql) ? ' AND '.implode(' AND ', $where_sql) : '').' 
ORDER BY '.$sort_by.' '.$sort_dir.', u.id ASC LIMIT '.$start_from.', 50
[/code]
All that's added right now is the reference for u.membergroupids.
From my limited experience so far I presume one cannot really pull another obtuse correlation out of this statment, for instance...
...in non-technical language...
AND SELECT g.g_user_title WHERE u.membergroupids for this u.id MATCHES g.g_id
AND JOIN THAT to the same ROW AS is currently being assembled for that user.

??Does this make sense?

[b] 2a) A LITTLE MORE....[/b]
Just below the queries containing the referenced SELECT statement(s), there is this code...
[code]if ($db->num_rows($result))
{
    while ($user_data = $db->fetch_assoc($result))
    {
        echo "memberGroupIds = ".$user_data['membergroupids']."<br />\n";  //debug
        $user_title_field = get_title($user_data);
[/code]

[b] 2b) THEN if you open include/functions.php, and under get_title($user), at ~ln500 , if you adjust the code there as follows, you will be able to observe the addition of the multigroupids values (numbers) next to the main g.g_user_title...[/b]
[code]
####### In include/functions.php, Find at about ln 510 ####################
###
    else if ($user['g_user_title'] != '')
        $user_title = pun_htmlspecialchars($user['g_user_title'].$user['membergroupids']);
###
###### REPLACE WITH #######
    else if ($user['g_user_title'] != '')
        $user_title = pun_htmlspecialchars(   $user['g_user_title'].(!is_null($user['membergroupids'])&&(!$user['membergroupids']==0)  ? ', '.$user['membergroupids'] : ''   ) );
[/code]

================================================
From what I have wrestled with so far (and my brain is a bit overworked, it could be the answer is staring me right in the face - as usually!),
   I am thinking I may need to prepare a second query and nestle it in just above that following while loop in #2a above, and then catch the value in the while loop process.  
   And then when I got that figured out for, say, as if multigroupids was a single value...  then I may be ready to figure out how to properly iterate the array for the values and match things up for the desired result.

I am looking for some suggestions for logic as to how to tacl;e this problem.  THANKS.

----------------------------------------------------
I know, I know... its a messy and difficult mod (lots of edits), but its not so poorly thought out really (kudos to noop and cybmat for taking the tough stab)) 
...but I did succeed in cleaning it up and tweaking it toward some more accomodating functionality (I have listed this at punres here: [url]http://www.punres.org/viewtopic.php?id=150)[/url], and it seems to be testing out really nicely at the present time, though I need to do more testing.

Any help and direction would be greatly apreciated, thanks.
Cheers, HTH]]></description>
			<author><![CDATA[dummy@example.com (twohawks)]]></author>
			<pubDate>Sat, 06 Dec 2008 10:12:48 +0000</pubDate>
			<guid>http://fluxbb.org/forums/topic/2312/sql-query-help-needed-userlist-related/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[submit button / ie7 issues]]></title>
			<link>http://fluxbb.org/forums/topic/2305/submit-button-ie7-issues/new/posts/</link>
			<description><![CDATA[Got a bit of a sticky problem, can't seem to be able to fix it...

I tried two ways to generate a submit button with a image. Both ways worked on FF3, doesn't on IE7.


#1. HTML:

<input type="submit" class="submit" value="" />

and the CSS:

.submit { height: 22px; width: 65px; background: url(button.gif); border: none; }



#2. HTML

<input type="image" src="button.gif" />




yea.. any thoughts would be greatly appreciated.]]></description>
			<author><![CDATA[dummy@example.com (itakou)]]></author>
			<pubDate>Wed, 03 Dec 2008 21:42:50 +0000</pubDate>
			<guid>http://fluxbb.org/forums/topic/2305/submit-button-ie7-issues/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Free PHP IDE]]></title>
			<link>http://fluxbb.org/forums/topic/2280/free-php-ide/new/posts/</link>
			<description><![CDATA[Hi everyone,
i was wondering if you guys know some good free (maybe open source) php ide ?

Thanks for your help, i've been searching on the internet but i can't make up my mind on which one to choose so i could use some user advice.]]></description>
			<author><![CDATA[dummy@example.com (eric235u)]]></author>
			<pubDate>Tue, 25 Nov 2008 22:38:22 +0000</pubDate>
			<guid>http://fluxbb.org/forums/topic/2280/free-php-ide/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[C++: stopping a while loop from outside]]></title>
			<link>http://fluxbb.org/forums/topic/2247/c-stopping-a-while-loop-from-outside/new/posts/</link>
			<description><![CDATA[I have a class. And in that class, I have a loop like this:

[code]
while (true) {
  if (check) {
    break;
  }

  ....
}
[/code]

Can I access the check variable from another class function during runtime?]]></description>
			<author><![CDATA[dummy@example.com (lie2815)]]></author>
			<pubDate>Wed, 19 Nov 2008 18:16:06 +0000</pubDate>
			<guid>http://fluxbb.org/forums/topic/2247/c-stopping-a-while-loop-from-outside/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[regular expression]]></title>
			<link>http://fluxbb.org/forums/topic/1610/regular-expression/new/posts/</link>
			<description><![CDATA[Does anyone know the regular expression of a list contianing numbers divided by a comma, eg:
1,2,3,4 or 33,22,32,12,54

I looked at [url]http://regexlib.com/[/url] but I could not find it.

^[0-9\s.\-]+$ does not work.

Someone any ideas?]]></description>
			<author><![CDATA[dummy@example.com (ridgerunner)]]></author>
			<pubDate>Tue, 18 Nov 2008 18:25:00 +0000</pubDate>
			<guid>http://fluxbb.org/forums/topic/1610/regular-expression/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Javascript Help]]></title>
			<link>http://fluxbb.org/forums/topic/2255/javascript-help/new/posts/</link>
			<description><![CDATA[I have a select box with a few options in, but if someone clicks the "Other" option, i want a text area to appear. This should be done with javascript, But i suck at javascript!
Can anyone help me out?

Thanks]]></description>
			<author><![CDATA[dummy@example.com (La`me)]]></author>
			<pubDate>Mon, 17 Nov 2008 01:26:22 +0000</pubDate>
			<guid>http://fluxbb.org/forums/topic/2255/javascript-help/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Nonce already used or out of range.]]></title>
			<link>http://fluxbb.org/forums/topic/2243/nonce-already-used-or-out-of-range/new/posts/</link>
			<description><![CDATA[Hi All

I am using JanRain PHP OpenId 2.0 for my OpenID implementation. I am getting the following response message "Nonce already used or out of range" .

After googling the issue i found that may be related to the time stamp of my application server that is linux server. But still i could not figure out the cause of the issue and the solution for the same.



PHP Version used - PHP 5
JanRain Version - 2.0
OS - Linux

Any help would be greatly appriciated.


Thanks]]></description>
			<author><![CDATA[dummy@example.com (elbekko)]]></author>
			<pubDate>Fri, 14 Nov 2008 20:10:42 +0000</pubDate>
			<guid>http://fluxbb.org/forums/topic/2243/nonce-already-used-or-out-of-range/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Em > Px]]></title>
			<link>http://fluxbb.org/forums/topic/1772/em-px/new/posts/</link>
			<description><![CDATA[When doing layouts with CSS, Is using em better to use rather than px?]]></description>
			<author><![CDATA[dummy@example.com (La`me)]]></author>
			<pubDate>Tue, 11 Nov 2008 23:50:52 +0000</pubDate>
			<guid>http://fluxbb.org/forums/topic/1772/em-px/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[RDFa + XHTML docs?]]></title>
			<link>http://fluxbb.org/forums/topic/2238/rdfa-xhtml-docs/new/posts/</link>
			<description><![CDATA[Would anyone happen to have some decent reference documentation sources for RDFa + XHTML combo's? Already read the W3C primer and follow on document, but they're a tad vague in quite a few areas, and all the other docs I've found so far seem obsessed with using meta and link tags instead of embedding the info in the existing divs, headers, a tags and such.

Just wanting to try and get a good overall view of the general semantics as well as more indepth specifics.


Cheers all. :)]]></description>
			<author><![CDATA[dummy@example.com (MattF)]]></author>
			<pubDate>Tue, 11 Nov 2008 10:02:16 +0000</pubDate>
			<guid>http://fluxbb.org/forums/topic/2238/rdfa-xhtml-docs/new/posts/</guid>
		</item>
		<item>
			<title><![CDATA[Content based on referer?]]></title>
			<link>http://fluxbb.org/forums/topic/2237/content-based-on-referer/new/posts/</link>
			<description><![CDATA[I've been playing with referrers on localhost somewhat unsuccessfully but have the following working on two test domains. I'm trying to show different content based on the referer, so anyone finding my site through any other means than fluxbb/punbb.org will see my normal portfolio site. Those coming from flux/pun will see my skins/mods etc.

[code]
<?php

$match = false;
$sites = array("fluxbb.org", "mynormalsite.com");

if(strlen($_SERVER['HTTP_REFERER']))
{
    $referer = parse_url($_SERVER['HTTP_REFERER']);
           
    $referer['host'] = str_replace("www.", "", strtolower($referer['host']));

    $match = in_array($referer['host'], $sites);
}

if($match)
{

?>

<html>
<head>
<title>My FluxBB Portfolio</title>
</head>
<body>
<p>Welcome FluxBB user! Here you can find my skins and mods free to download.</p>
</body>
</html>

<?php
}
else
{
?>

<html>
<head>
<title>My Non-FluxBB/PunBB Related Stuff</title>
</head>
<body>
<p>Welcome to my portfolio of non-fluxbb related things.</p>
</body>
</html>

<?php
}
?>
[/code]

I'm looking to throw a third site into the array so that users coming from PunBB will see my "PunBB mods" page, whereas users coming from FluxBB will see my "FluxBB mods" page. If the referrer is blank or doesnt match fluxbb.org/punbb.org it should just show my normal site.

If someone can code up a basic working example with a third site loaded in the array (and a seperate third html sheet) I'd be glad to shoot over some beer money through paypal. Cheers :)]]></description>
			<author><![CDATA[dummy@example.com (Tyler)]]></author>
			<pubDate>Tue, 11 Nov 2008 04:17:58 +0000</pubDate>
			<guid>http://fluxbb.org/forums/topic/2237/content-based-on-referer/new/posts/</guid>
		</item>
	</channel>
</rss>
