Feed Preview
 

 
There are many code guidelines, and now there's yet another named..... PSR
And guess what.....
https://www.php-fig.org/psr/psr-2/#1-overview
Quote:
Code MUST use 4 spaces for indenting, not tabs.


So now i hate everyone that says my code is not PSR compliant Wink
Thank you, neralex. I look forward to trying it out
http://www.ravenphpscripts.com/ftopicp-165925.html#165925
neralex wrote:
1. jQuery isn't updated since many years on this old stable build because in this case many other used jQuery plugins must be updated too. It works as it is. Maybe when I have time in the next days, I will try to update all plugins to the latest jQuery 3.3.x for the next RN25x fix package.


# jQuery cookie replaced with JavaScript Cookie v2.2.0
# jQuery validate updated to 1.17.0
# jQuery superfish updated to 1.7.9
# jQuery hoverIntent updated to 1.9.0
# jQuery colorbox updated to 1.6.4
# jQuery updated to 3.3.1

Wink
Bootstrap is not webdesign in general its a css-framework with a responsive grid-system and some jquery-plugins. If you want also use the plugins, then you have to add the bootstrap.min.js after the jquery-frameworks and NOT a css-file but maybe it was an typo in your post. But this has nothing to do with the jquery-framework versions. Just you need jquery-framework to use the bootstrap-plugins like carusel - not more.

If you are creating a complex grid with your own skills - just do it! Smile But for me is it simply wasted time because with bootstrap I have the time to build the real webdesign-elements without to create my very own grid, which will be out-of-date in not more than 1 year. Why should I do this? Bootstrap is an great example how you can use your own webdesign-elements while the grid-system is changed in the background from css-floats to flex-box. You will nothing lose of your own styles - its just perfect. On the same way with foundation or other grid-systems. At the end a framework like this is very helpful to provide a responsive layout structure - so why not?! If someone wants to create his own template-grid - ok fine. Its all open source and everyone can change it.

I also had it seen that some devs are destroying templates with it but this is not really caused by bootstrap - it s caused by the devs itself.

I don't know why the joomla-devs are doing this but it makes sense to load maybe the latest jquery framework, after that the latest jquery-migration and then all you needed jquery-plugins. The migration is providing the backward compatibility for old jquery-plugins, jquery-ui is only another collection of plugins. Ya for sure it makes more sense to replace the plugins with newer version as long they are available. But this you can try to explain the users, who are haven't the knowlegde about it and they are only crying why plugins are not more working.

But I follow your way like to add only one jquery-version and the plugins should be loaded only on the needed areas and not all together on each page.

Wink
Thanks, nerelax. I'll check it out when I get a chance.
Hi djmaze, great to see you again!

I'm not sure when I'll have a chance, but hopefully can take a look at this as it looks like there are many interesting improvements in it!
Thanks!
While testing the php7 prepared version of RN251, I stumbled again over this issue. I added Plabin's fix in the new package.

For manually fix open: /blocks/block-ForumsCollapsing.php

find:
php Code:
if ($showJumpBoxes) {

if(!defined('IN_PHPBB')) define('IN_PHPBB', TRUE);
require_once NUKE_MODULES_DIR . 'Forums/includes/constants.php';
$sql = 'SELECT c.cat_id, c.cat_title, c.cat_order

remove:
php Code:
	if(!defined('IN_PHPBB')) define('IN_PHPBB', TRUE);

require_once NUKE_MODULES_DIR . 'Forums/includes/constants.php';


find (on top):
php Code:
global $admin, $bgcolor1, $bgcolor2, $currentlang, $db, $language, $prefix, $sitename, $textcolor1, $textcolor2, $user, $userinfo, $user_prefix;

add after:
php Code:
if(!defined('IN_PHPBB')) define('IN_PHPBB', TRUE);

require_once NUKE_MODULES_DIR . 'Forums/includes/constants.php';


find:
php Code:
if (!function_exists('auth')) {

function auth($userdata) {
global $db, $prefix;

$a_sql = 'auth_view, auth_read';
$auth_fields = array('auth_view', 'auth_read');

/*
* We need to pull the auth information on the all forums
*/

$sql = 'SELECT forum_id, ' . $a_sql
. ' FROM `' . $prefix . '_bbforums`';
$result = $db->sql_query($sql);

if ( !($f_access = $db->sql_fetchrowset($result)) ) {
return array();
}

/*
* If the user isn't logged on then all we need do is check if the forum
* has the type set to ALL, if yes they are good to go, if not then they
* are denied access
*/
$u_access = array();

$sql = 'SELECT a.forum_id, ' . $a_sql . ', a.auth_mod '
. 'FROM `' . $prefix . '_bbauth_access` a, `' . $prefix . '_bbuser_group` ug '
. 'WHERE ug.user_id = ' . $userdata['user_id']
. ' AND ug.user_pending = 0'
. ' AND a.group_id = ug.group_id';
$result = $db->sql_query($sql);

if ( $row = $db->sql_fetchrow($result) ) {
do{
$u_access[$row['forum_id']][] = $row;
} while( $row = $db->sql_fetchrow($result) );
}

/*
* Is user an admin?
*/
$is_admin = ( $userdata['user_level'] == 2 ) ? TRUE : 0;

$auth_user = array();
for($i = 0; $i < count($auth_fields); $i++) {
$key = $auth_fields[$i];

/*
* If the type if ACL, MOD or ADMIN then we need to see if the user has specific permissions
* to do whatever it is they want to do ... to do this we pull relevant information for the
* user (and any groups they belong to)
*
* Now we compare the users access level against the forums. We assume here that a moderator
* and admin automatically have access to an ACL forum, similarly we assume admins meet an
* auth requirement of MOD
*/
for($k = 0; $k < count($f_access); $k++) {
$value = $f_access[$k][$key];
$f_forum_id = $f_access[$k]['forum_id'];
$u_access[$f_forum_id] = isset($u_access[$f_forum_id]) ? $u_access[$f_forum_id] : array();
switch( $value ) {
case AUTH_ALL:
$auth_user[$f_forum_id][$key] = TRUE;
break;
case AUTH_REG:
$auth_user[$f_forum_id][$key] = TRUE;
break;
case AUTH_ACL:
$auth_user[$f_forum_id][$key] = auth_check_user(AUTH_ACL, $key, $u_access[$f_forum_id], $is_admin);
break;
case AUTH_MOD:
$auth_user[$f_forum_id][$key] = auth_check_user(AUTH_MOD, 'auth_mod', $u_access[$f_forum_id], $is_admin);
break;
case AUTH_ADMIN:
$auth_user[$f_forum_id][$key] = $is_admin;
break;
default:
$auth_user[$f_forum_id][$key] = 0;
break;
}
}
}

/*
* Is user a moderator?
*/
for($k = 0; $k < count($f_access); $k++) {
$f_forum_id = $f_access[$k]['forum_id'];

$u_access[$f_forum_id] = isset($u_access[$f_forum_id]) ? $u_access[$f_forum_id] : array();
$auth_user[$f_forum_id]['auth_mod'] = auth_check_user(AUTH_MOD, 'auth_mod', $u_access[$f_forum_id], $is_admin);
}

return $auth_user;
}
}


replace it with:
php Code:
if (!function_exists('auth')) {

function auth($userdata) {
global $db, $prefix, $user;

$a_sql = 'auth_view, auth_read';
$auth_fields = array('auth_view', 'auth_read');

/*
* We need to pull the auth information on the all forums
*/

$sql = 'SELECT forum_id, ' . $a_sql
. ' FROM `' . $prefix . '_bbforums`';
$result = $db->sql_query($sql);

if ( !($f_access = $db->sql_fetchrowset($result)) ) {
return array();
}

/*
* If the user isn't logged on then all we need do is check if the forum
* has the type set to ALL, if yes they are good to go, if not then they
* are denied access
*/
$u_access = array();

if (is_user($user)) {
$sql = 'SELECT a.forum_id, ' . $a_sql . ', a.auth_mod '
. 'FROM `' . $prefix . '_bbauth_access` a, `' . $prefix . '_bbuser_group` ug '
. 'WHERE ug.user_id = ' . $userdata['user_id']
. ' AND ug.user_pending = 0'
. ' AND a.group_id = ug.group_id';
$result = $db->sql_query($sql);

if ( $row = $db->sql_fetchrow($result) ) {
do{
$u_access[$row['forum_id']][] = $row;
} while( $row = $db->sql_fetchrow($result) );
}
/*
* Is user an admin?
*/
$is_admin = ( $userdata['user_level'] == 2 ) ? TRUE : 0;
} else {
$is_admin = 0;
}

$auth_user = array();
for($i = 0; $i < count($auth_fields); $i++) {
$key = $auth_fields[$i];

/*
* If the type if ACL, MOD or ADMIN then we need to see if the user has specific permissions
* to do whatever it is they want to do ... to do this we pull relevant information for the
* user (and any groups they belong to)
*
* Now we compare the users access level against the forums. We assume here that a moderator
* and admin automatically have access to an ACL forum, similarly we assume admins meet an
* auth requirement of MOD
*/
for($k = 0; $k < count($f_access); $k++) {
$value = $f_access[$k][$key];
$f_forum_id = $f_access[$k]['forum_id'];
$u_access[$f_forum_id] = isset($u_access[$f_forum_id]) ? $u_access[$f_forum_id] : array();
switch( $value ) {
case AUTH_ALL:
$auth_user[$f_forum_id][$key] = TRUE;
break;
case AUTH_REG:
$auth_user[$f_forum_id][$key] = TRUE;
break;
case AUTH_ACL:
$auth_user[$f_forum_id][$key] = auth_check_user(AUTH_ACL, $key, $u_access[$f_forum_id], $is_admin);
break;
case AUTH_MOD:
$auth_user[$f_forum_id][$key] = auth_check_user(AUTH_MOD, 'auth_mod', $u_access[$f_forum_id], $is_admin);
break;
case AUTH_ADMIN:
$auth_user[$f_forum_id][$key] = $is_admin;
break;
default:
$auth_user[$f_forum_id][$key] = 0;
break;
}
}
}

/*
* Is user a moderator?
*/
for($k = 0; $k < count($f_access); $k++) {
$f_forum_id = $f_access[$k]['forum_id'];

$u_access[$f_forum_id] = isset($u_access[$f_forum_id]) ? $u_access[$f_forum_id] : array();
$auth_user[$f_forum_id]['auth_mod'] = auth_check_user(AUTH_MOD, 'auth_mod', $u_access[$f_forum_id], $is_admin);
}

return $auth_user;
}
}


I notcied that the same sql-error exists in the /blocks/block-Forums.php:

find:
php Code:
if (!function_exists('auth')) {

function auth($userdata) {
global $db, $prefix;

$a_sql = 'auth_view, auth_read';
$auth_fields = array('auth_view', 'auth_read');

/*
* We need to pull the auth information on the all forums
*/

$sql = 'SELECT forum_id, ' . $a_sql
. ' FROM `' . $prefix . '_bbforums`';
$result = $db->sql_query($sql);

if ( !($f_access = $db->sql_fetchrowset($result)) ) {
return array();
}

/*
* If the user isn't logged on then all we need do is check if the forum
* has the type set to ALL, if yes they are good to go, if not then they
* are denied access
*/
$u_access = array();

$sql = 'SELECT a.forum_id, ' . $a_sql . ', a.auth_mod '
. 'FROM `' . $prefix . '_bbauth_access` a, `' . $prefix . '_bbuser_group` ug '
. 'WHERE ug.user_id = ' . $userdata['user_id']
. ' AND ug.user_pending = 0'
. ' AND a.group_id = ug.group_id';
$result = $db->sql_query($sql);

if ( $row = $db->sql_fetchrow($result) ) {
do{
$u_access[$row['forum_id']][] = $row;
} while( $row = $db->sql_fetchrow($result) );
}

/*
* Is user an admin?
*/
$is_admin = ( $userdata['user_level'] == 2 ) ? TRUE : 0;

$auth_user = array();
for($i = 0; $i < count($auth_fields); $i++) {
$key = $auth_fields[$i];

/*
* If the type if ACL, MOD or ADMIN then we need to see if the user has specific permissions
* to do whatever it is they want to do ... to do this we pull relevant information for the
* user (and any groups they belong to)
*
* Now we compare the users access level against the forums. We assume here that a moderator
* and admin automatically have access to an ACL forum, similarly we assume admins meet an
* auth requirement of MOD
*/
for($k = 0; $k < count($f_access); $k++) {
$value = $f_access[$k][$key];
$f_forum_id = $f_access[$k]['forum_id'];
$u_access[$f_forum_id] = isset($u_access[$f_forum_id]) ? $u_access[$f_forum_id] : array();
switch( $value ) {
case AUTH_ALL:
$auth_user[$f_forum_id][$key] = TRUE;
break;
case AUTH_REG:
$auth_user[$f_forum_id][$key] = TRUE;
break;
case AUTH_ACL:
$auth_user[$f_forum_id][$key] = auth_check_user(AUTH_ACL, $key, $u_access[$f_forum_id], $is_admin);
break;
case AUTH_MOD:
$auth_user[$f_forum_id][$key] = auth_check_user(AUTH_MOD, 'auth_mod', $u_access[$f_forum_id], $is_admin);
break;
case AUTH_ADMIN:
$auth_user[$f_forum_id][$key] = $is_admin;
break;
default:
$auth_user[$f_forum_id][$key] = 0;
break;
}
}
}

/*
* Is user a moderator?
*/
for($k = 0; $k < count($f_access); $k++) {
$f_forum_id = $f_access[$k]['forum_id'];

$u_access[$f_forum_id] = isset($u_access[$f_forum_id]) ? $u_access[$f_forum_id] : array();
$auth_user[$f_forum_id]['auth_mod'] = auth_check_user(AUTH_MOD, 'auth_mod', $u_access[$f_forum_id], $is_admin);
}

return $auth_user;
}
}


replace it with:
php Code:
if (!function_exists('auth')) {

function auth($userdata) {
global $db, $prefix, $user;

$a_sql = 'auth_view, auth_read';
$auth_fields = array('auth_view', 'auth_read');

/*
* We need to pull the auth information on the all forums
*/

$sql = 'SELECT forum_id, ' . $a_sql
. ' FROM `' . $prefix . '_bbforums`';
$result = $db->sql_query($sql);

if ( !($f_access = $db->sql_fetchrowset($result)) ) {
return array();
}

/*
* If the user isn't logged on then all we need do is check if the forum
* has the type set to ALL, if yes they are good to go, if not then they
* are denied access
*/
$u_access = array();

if (is_user($user)) {
$sql = 'SELECT a.forum_id, ' . $a_sql . ', a.auth_mod '
. 'FROM `' . $prefix . '_bbauth_access` a, `' . $prefix . '_bbuser_group` ug '
. 'WHERE ug.user_id = ' . $userdata['user_id']
. ' AND ug.user_pending = 0'
. ' AND a.group_id = ug.group_id';
$result = $db->sql_query($sql);

if ( $row = $db->sql_fetchrow($result) ) {
do{
$u_access[$row['forum_id']][] = $row;
} while( $row = $db->sql_fetchrow($result) );
}
/*
* Is user an admin?
*/
$is_admin = ( $userdata['user_level'] == 2 ) ? TRUE : 0;
} else {
$is_admin = 0;
}

$auth_user = array();
for($i = 0; $i < count($auth_fields); $i++) {
$key = $auth_fields[$i];

/*
* If the type if ACL, MOD or ADMIN then we need to see if the user has specific permissions
* to do whatever it is they want to do ... to do this we pull relevant information for the
* user (and any groups they belong to)
*
* Now we compare the users access level against the forums. We assume here that a moderator
* and admin automatically have access to an ACL forum, similarly we assume admins meet an
* auth requirement of MOD
*/
for($k = 0; $k < count($f_access); $k++) {
$value = $f_access[$k][$key];
$f_forum_id = $f_access[$k]['forum_id'];
$u_access[$f_forum_id] = isset($u_access[$f_forum_id]) ? $u_access[$f_forum_id] : array();
switch( $value ) {
case AUTH_ALL:
$auth_user[$f_forum_id][$key] = TRUE;
break;
case AUTH_REG:
$auth_user[$f_forum_id][$key] = TRUE;
break;
case AUTH_ACL:
$auth_user[$f_forum_id][$key] = auth_check_user(AUTH_ACL, $key, $u_access[$f_forum_id], $is_admin);
break;
case AUTH_MOD:
$auth_user[$f_forum_id][$key] = auth_check_user(AUTH_MOD, 'auth_mod', $u_access[$f_forum_id], $is_admin);
break;
case AUTH_ADMIN:
$auth_user[$f_forum_id][$key] = $is_admin;
break;
default:
$auth_user[$f_forum_id][$key] = 0;
break;
}
}
}

/*
* Is user a moderator?
*/
for($k = 0; $k < count($f_access); $k++) {
$f_forum_id = $f_access[$k]['forum_id'];

$u_access[$f_forum_id] = isset($u_access[$f_forum_id]) ? $u_access[$f_forum_id] : array();
$auth_user[$f_forum_id]['auth_mod'] = auth_check_user(AUTH_MOD, 'auth_mod', $u_access[$f_forum_id], $is_admin);
}

return $auth_user;
}
}
No.
 

Subscribe


Add to Google
Add to My Yahoo!
Add to My AOL
Add to My MSN
Subscribe with Bloglines
Add to netvibes
Subscribe in NewsGator Online
Subscribe with PageFlakes
Subscribe in Rojo
Add this site to your Protopage
Add to Newsburst
Subscribe in NewsAlloy
Add to Blogarithm
Ravens PHP Scripts And Web Hosting Forums in ATOM 1.0 format
Ravens PHP Scripts And Web Hosting Forums in RSS 0.91 format
Ravens PHP Scripts And Web Hosting Forums in RSS 2.0 format


Valid Atom 1.0
Valid RSS
 

Site Info v2.2.2

Last SeenLast Seen
Server TrafficServer Traffic
  • Total: 347,836,452
  • Today: 27,920
Server InfoServer Info
  • Feb 18, 2018
  • 10:17 am PST
 
 

Daily Inspiration