[ABD] phpBB Social Network 0.7.2

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
User avatar
RMcGirr83
Former Team Member
Posts: 22016
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: [RC] phpBB3 Social Network 0.6.0

Post by RMcGirr83 »

That was implemented due to firebird databases as their indexes can't be longer than 31 characters. If I recall correctly.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beer Image
chiroz223
Registered User
Posts: 44
Joined: Tue Jun 01, 2010 10:28 am

Re: [RC] phpBB3 Social Network 0.6.0

Post by chiroz223 »

Hey, I am wondering if there is anyway I could edit the mod to show 'friends' in profile sideways ranther than vertical? In the meantime, I removed the part that showed the username of the user as it was making the page look wierd (which I will add back in if I do find a fix for my problem).

This is what I mean by it displaying vertically:
Image

Any help is truly appreciated. :)
User avatar
BiggDawgg
Registered User
Posts: 356
Joined: Tue Oct 19, 2004 8:46 am
Location: USA, Illinois
Contact:

Re: [RC] phpBB3 Social Network 0.6.0

Post by BiggDawgg »

just marking topic so I can follow it ;)
swapvn
Registered User
Posts: 72
Joined: Thu Mar 17, 2011 7:33 am

Re: [RC] phpBB3 Social Network 0.6.0

Post by swapvn »

Hello everyone,
Can some one help me to add the code in the over_header.html ? My style is hestia purple.
I have to find

Code: Select all

<div class="navbar">

Code: Select all

<ul class="linklist navlinks">

Code: Select all

<div id="page-body">

but I don;t see it in my style. Some one know where to add the code. Thank you very much

Here is over_header.html

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head>
<!-- INCLUDE ca_config.html -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="content-language" content="{S_USER_LANG}" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="imagetoolbar" content="no" />
{META}
<title>{SITENAME} - <!-- IF S_IN_MCP -->{L_MCP} - <!-- ELSEIF S_IN_UCP -->{L_UCP} - <!-- ENDIF -->{PAGE_TITLE}</title>

<!-- IF S_ENABLE_FEEDS -->
	<!-- IF S_ENABLE_FEEDS_OVERALL --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {SITENAME}" href="{U_FEED}" /><!-- ENDIF -->
	<!-- IF S_ENABLE_FEEDS_NEWS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_NEWS}" href="{U_FEED}?mode=news" /><!-- ENDIF -->
	<!-- IF S_ENABLE_FEEDS_FORUMS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_ALL_FORUMS}" href="{U_FEED}?mode=forums" /><!-- ENDIF -->
	<!-- IF S_ENABLE_FEEDS_TOPICS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_NEW}" href="{U_FEED}?mode=topics" /><!-- ENDIF -->
	<!-- IF S_ENABLE_FEEDS_TOPICS_ACTIVE --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_ACTIVE}" href="{U_FEED}?mode=topics_active" /><!-- ENDIF -->
	<!-- IF S_ENABLE_FEEDS_FORUM and S_FORUM_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FORUM} - {FORUM_NAME}" href="{U_FEED}?f={S_FORUM_ID}" /><!-- ENDIF -->
	<!-- IF S_ENABLE_FEEDS_TOPIC and S_TOPIC_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_TOPIC} - {TOPIC_TITLE}" href="{U_FEED}?f={S_FORUM_ID}&t={S_TOPIC_ID}" /><!-- ENDIF -->
<!-- ENDIF -->

<!--
   phpBB style name: Hestia Purple
   Based on style:   subsilver2
   Original author:  Tom Beddard ( http://www.subBlue.com/ )
   Modified by:      stsoftware ( http://www.stsoftware.biz/ )

   NOTE: This page was generated by phpBB, the free open-source bulletin board package.
         The phpBB Group is not responsible for the content of this page and forum. For more information
         about phpBB please visit http://www.phpbb.com
-->

<!-- INCLUDE socialnet/overall_header_hook.html -->
<link rel="stylesheet" href="{T_STYLESHEET_LINK}" type="text/css" />

<script type="text/javascript">
// <![CDATA[

	var onload_functions = new Array();
	var onunload_functions = new Array();
	var ca_main_width = '{$CA_WIDTH}';

<!-- IF S_USER_PM_POPUP -->
	if ({S_NEW_PM})
	{
		popup('{UA_POPUP_PM}', 400, 225, '_phpbbprivmsg');
	}
<!-- ENDIF -->

function popup(url, width, height, name)
{
	if (!name)
	{
		name = '_popup';
	}

	window.open(url.replace(/&/g, '&'), name, 'height=' + height + ',resizable=yes,scrollbars=yes,width=' + width);
	return false;
}

function jumpto()
{
	var page = prompt('{LA_JUMP_PAGE}:', '{ON_PAGE}');
	var per_page = '{PER_PAGE}';
	var base_url = '{A_BASE_URL}';

	if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0)
	{
		if (base_url.indexOf('?') == -1)
		{
			document.location.href = base_url + '?start=' + ((page - 1) * per_page);
		}
		else
		{
			document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page);
		}
	}
}

/**
* Find a member
*/
function find_username(url)
{
	popup(url, 760, 570, '_usersearch');
	return false;
}

/**
* Mark/unmark checklist
* id = ID of parent container, name = name prefix, state = state [true/false]
*/
function marklist(id, name, state)
{
	var parent = document.getElementById(id);
	if (!parent)
	{
		eval('parent = document.' + id);
	}

	if (!parent)
	{
		return;
	}

	var rb = parent.getElementsByTagName('input');
	
	for (var r = 0; r < rb.length; r++)
	{
		if (rb[r].name.substr(0, name.length) == name)
		{
			rb[r].checked = state;
		}
	}
}

<!-- IF ._file -->

	/**
	* Play quicktime file by determining it's width/height
	* from the displayed rectangle area
	*
	* Only defined if there is a file block present.
	*/
	function play_qt_file(obj)
	{
		var rectangle = obj.GetRectangle();

		if (rectangle)
		{
			rectangle = rectangle.split(',')
			var x1 = parseInt(rectangle[0]);
			var x2 = parseInt(rectangle[2]);
			var y1 = parseInt(rectangle[1]);
			var y2 = parseInt(rectangle[3]);

			var width = (x1 < 0) ? (x1 * -1) + x2 : x2 - x1;
			var height = (y1 < 0) ? (y1 * -1) + y2 : y2 - y1;
		}
		else
		{
			var width = 200;
			var height = 0;
		}

		obj.width = width;
		obj.height = height + 16;

		obj.SetControllerVisible(true);

		obj.Play();
	}
<!-- ENDIF -->

	/**
	* New function for handling multiple calls to window.onload and window.unload by pentapenguin
	*/
	window.onload = function()
	{
		for (var i = 0; i < onload_functions.length; i++)
		{
			eval(onload_functions[i]);
		}
	}

	window.onunload = function()
	{
		for (var i = 0; i < onunload_functions.length; i++)
		{
			eval(onunload_functions[i]);
		}
	}


if(navigator.userAgent && navigator.userAgent.indexOf('Mac OS X') > 0)
{
	document.write('<link rel="stylesheet" href="{T_THEME_PATH}/mac.css" type="text/css" />');
}

// ]]>
</script>
<script type="text/javascript" src="{T_TEMPLATE_PATH}/ca_scripts.js"></script>
</head>
<body class="{S_CONTENT_DIRECTION}<!-- IF SN_MODULE_IM_ENABLED --> im-page<!-- ENDIF -->">

<a name="top"></a>

<div id="logo-row">
    <div id="logo-left">
        <div id="logo-right">
            <!-- IF not S_IS_BOT -->
                <!-- IF S_USER_LOGGED_IN -->
                    <div id="logo-registered">
						<!-- IF S_DISPLAY_PM -->
						    <a href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}<!-- IF PRIVATE_MESSAGE_INFO_UNREAD -->, {PRIVATE_MESSAGE_INFO_UNREAD}<!-- ENDIF --></a><br />
                        <!-- ENDIF -->
                        {LAST_VISIT_DATE}<br />
                        {CURRENT_TIME}
                    </div>
                <!-- ELSE -->
                    <!-- IF S_LOGIN_ACTION -->
                    <div id="logo-login">
                        <form method="post" action="{S_LOGIN_ACTION}">
                            <input class="post" type="text" name="username" size="7" title="{LA_USERNAME}" /> <input class="post" type="password" name="password" size="7" title="{LA_PASSWORD}" /><br />
                            <!-- IF S_AUTOLOGIN_ENABLED --><input type="checkbox" class="radio" name="autologin" title="{LA_LOG_ME_IN}" />&nbsp;<!-- ENDIF --> <input type="submit" class="btnmain" name="login" value="{L_LOGIN}" />
                        	{S_FORM_TOKEN}
                        </form>
                    </div>
                    <!-- ENDIF -->
                <!-- ENDIF -->
            <!-- ENDIF -->
            <a href="{U_INDEX}">{SITE_LOGO_IMG}</a>
            <div id="logo-clear"></div>
        </div>
    </div>
</div>
<div class="navrow">
    <!-- IF not S_IS_BOT -->
        <!-- IF S_USER_LOGGED_IN --><a href="{U_PROFILE}">{L_PROFILE}</a> &#8226; <!-- ENDIF -->
        <!-- IF S_USER_LOGGED_IN -->
            <!-- IF S_DISPLAY_PM --><a href="{U_PRIVATEMSGS}">{L_PRIVATE_MESSAGES}</a> &#8226; <!-- ENDIF -->
        <!-- ELSEIF S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) --><a href="{U_REGISTER}">{L_REGISTER}</a> &#8226; <!-- ENDIF -->
    <!-- ENDIF -->
    <!-- IF U_RESTORE_PERMISSIONS --><a href="{U_RESTORE_PERMISSIONS}">{L_RESTORE_PERMISSIONS}</a> &#8226; <!-- ENDIF -->
    <a href="{U_FAQ}">{L_FAQ}</a>
    <!-- IF S_DISPLAY_SEARCH --> &#8226; <a href="{U_SEARCH}">{L_SEARCH}</a><!-- ENDIF -->
    <!-- IF not S_IS_BOT -->
        <!-- IF S_DISPLAY_MEMBERLIST --> &#8226; <a href="{U_MEMBERLIST}">{L_MEMBERLIST}</a><!-- ENDIF -->
    <!-- ENDIF -->
    <!-- IF not S_IS_BOT --> &#8226; <a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a><!-- ENDIF -->
</div>
<div id="content">
<table border="0" cellspacing="0" cellpadding="0" width="{$CA_WIDTH}" id="maintable" align="center">
<tr>
	<td id="contentrow">

<!-- IF not S_IS_BOT && not $CA_SKIP_PM_NOTIFY && S_USER_LOGGED_IN && S_DISPLAY_PM -->
	<!-- IF S_USER_NEW_PRIVMSG -->
		<div class="pm-notify-new"><div class="pm-notify-header">{L_PRIVATE_MESSAGES}</div><a href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}<!-- IF PRIVATE_MESSAGE_INFO_UNREAD -->, {PRIVATE_MESSAGE_INFO_UNREAD}<!-- ENDIF --></a></div>
	<!-- ELSEIF S_USER_UNREAD_PRIVMSG -->
		<div class="pm-notify-unread"><div class="pm-notify-header">{L_PRIVATE_MESSAGES}</div><a href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}<!-- IF PRIVATE_MESSAGE_INFO_UNREAD -->, {PRIVATE_MESSAGE_INFO_UNREAD}<!-- ENDIF --></a></div>
	<!-- ENDIF -->
<!-- ENDIF -->  

<!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN and (U_MCP or U_ACP) -->
	<div class="pm-notify-new"><div class="pm-notify-header">{L_INFORMATION}</div>{L_BOARD_DISABLED}</div>
<!-- ENDIF -->

	<!-- IF S_DISPLAY_SEARCH -->
	<p class="searchbar">
		<span style="float: {S_CONTENT_FLOW_BEGIN};"><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a> | <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></span>
		<!-- IF S_USER_LOGGED_IN -->
		<span style="float: {S_CONTENT_FLOW_END};"><!-- IF S_LOAD_UNREADS --><a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a> | <!-- ENDIF --> <a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a> | <a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a></span>
		<!-- ELSE -->
		<span style="float: {S_CONTENT_FLOW_END};">{CURRENT_TIME}</span>
		<!-- ENDIF -->
	</p>
	<!-- ENDIF -->

	<br style="clear: both;" />

	<!-- INCLUDE breadcrumbs.html -->

	<br />

User avatar
Alien_Time
Registered User
Posts: 389
Joined: Fri Dec 31, 2010 7:08 am

Re: [RC] phpBB3 Social Network 0.6.0

Post by Alien_Time »

Hi everyone,

I have just installed the v0.6.0 of this mod in my phpbb 3.0.9 and it works good. Its such an awesome MOD..

I have a problem that I have been searching to find an answer..I have noticed a lot of people having similar problem as this but I couldnt find a solution and a fix to this!

My problem is: When you go to the mainpage.php (when you are logged-in), you can see everything as its supposed to be. Everything works including the Chat. However, under the "FRIENDS ONLINE" heading (on the left side in the mainpage), there are no contents and its just empty. I understand that it wont show anything if the friends are not online. But in this case it should atleast show "No online user"..Also I have noticed that it is still empty even if there are users online. But the chat still works and I am able to chat to the other users as well! Any idea on why this is happening? I have installed the mod and everything seems to be working so far..still on the testing stage...

I dont have a test user account yet since I am testing it offline now.

Thanx for any support..

Cheers,
User avatar
Kamahl19
Registered User
Posts: 1598
Joined: Tue Nov 06, 2007 3:33 pm
Location: Slovakia
Name: Martin
Contact:

Re: [RC] phpBB3 Social Network 0.6.0

Post by Kamahl19 »

Next version is comming, slowly but comming :D It took 3 months so I hope you all will be impressed :)

There are many fixes and small improvements and some really big changes for example:
- new user profile - screens: http://i51.tinypic.com/2mfuk5.gif , http://i54.tinypic.com/28nvxz.gif , http://i51.tinypic.com/k4fmld.gif, http://i52.tinypic.com/27wynb5.gif
- friends group - screen: http://i56.tinypic.com/9u2dls.gif
superj707
Registered User
Posts: 1136
Joined: Thu Feb 26, 2009 12:20 am

Re: [RC] phpBB3 Social Network 0.6.0

Post by superj707 »

This looks friggen exciting!! I am at work and just gave a loud wooot! in the office. Everyone heard me... DANG

Anyway, awesome job can't wait for it. My favorite thing is the friends groups wow.. oh and LOL at group "morons" HAHAHAH
clabit
Registered User
Posts: 13
Joined: Wed Aug 03, 2011 7:08 am

Re: [RC] phpBB3 Social Network 0.6.0

Post by clabit »

hello
When I click the tab acp_cat_socialnet gives me following error

Parse error: syntax error, unexpected T_STRING in /home/legiosec/public_html/forum/includes/acp/acp_socialnet.php on line 741

file

Code: Select all

<?php

/**
 *
 * @package Socialnet
 * @subpackage ACP
 * @version $Id$
 * @copyright (c) 2010 Kamahl, Culprit
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 *
 */

/**
 * @ignore
 */
if (!defined('IN_PHPBB'))
{
	exit;
}

/**
 * @package Socialnet
 * @subpackage ACP
 */
class acp_socialnet
{
	/**
	 * @var string $mode Default phpBB variable called from $p_master
	 */
	var $mode = '';
	/**
	 * @var string $u_action Kompletni ACP URL pro odesilani formularu
	 */
	var $u_action;
	/**
	 * @var string $acpPanel_title Zakladni nadpis ACP panelu
	 */
	var $acpPanel_title = '';
	/**
	 * @var string $acpPanel_explain Zakladni popis panelu pod titulkem
	 */
	var $acpPanel_explain = '';
	/**
	 * @var string $motivationPicture URL motivacniho obrazku
	 */
	var $motivationPicture = '';
	/**
	 * @var array $new_config Pole pro nove nastaveni
	 */
	var $new_config = array();

	function main($id, $mode)
	{
		global $config, $db, $user, $auth, $template;
		global $phpbb_root_path, $phpbb_admin_path, $phpEx, $socialnet_root_path;

		$user->add_lang(array('acp/common', 'acp/board', 'mods/socialnet_acp'));

		$this->tpl_name = 'acp_socialnet';
		$this->page_title = 'ACP_CAT_SOCIALNET';
		$this->acpPanel_title = $user->lang[$this->page_title];

		// Default call function
		$call_module = 'sett_main';
		$module_match = array();

		// Prepare function call for ACP panel
		if (preg_match('/^module_(.+)/i', $mode, $module_match))
		{
			$call_module = 'module';
			$module = $module_match[1];
		} else if ($mode != 'main')
		{
			$call_module = $mode;
			$module = $mode;
		} else
		{
			$module = $mode;
			$mode = 'socialNet';
		}
		// Call specific function of this module dependend on $mode
		$this->$call_module($id, $module);

		// Prepare motivation picture
		$this->motivationPicture = $socialnet_root_path . 'styles/images/' . $mode . '.png';

		$template->assign_vars(array(
			'L_TITLE'					 => $this->acpPanel_title,
			'L_TITLE_EXPLAIN'			 => $this->acpPanel_explain,
			'T_SOCIALNET_IMAGES_PATH'	 => $socialnet_root_path . 'styles/images',
			'S_MOTIONPICTURE'			 => file_exists($this->motivationPicture) ? true : false,
			'S_MOTIONPICTURE_IMG_URL'	 => $this->motivationPicture,
			'S_MODE'					 => $mode,
		));
	}

	/**
	 * Loads configuration panel for any module defined in acp
	 * @access public
	 * @param integer $id phpBB variable
	 * @param string $module  Which acp panel module should be loaded into phpBB ACP
	 * @return void
	 */
	function module($id, $module)
	{
		global $config, $user, $auth, $template;
		global $phpbb_root_path, $phpbb_admin_path, $phpEx, $socialnet_root_path;

		$access_module = true;
		$error = array();

		// IS module enabled?
		if ($config['module_' . $module] == 0 || $config['sn_global_enable'] == 0)
		{
			$error[] = $user->lang['SN_MODULE_DISABLED'];
		}

		$module_acp_filename = "{$socialnet_root_path}acp/acp_{$module}.{$phpEx}";
		$module_filename = "{$socialnet_root_path}{$module}.{$phpEx}";

		// Exists ACP function file for this module?
		$s_sn_module = isset($user->lang['SN_MODULE_' . strtoupper($module)]) ? $user->lang['SN_MODULE_' . strtoupper($module)] : '{ SN_MODULE_' . strtoupper($module) . ' }';
		if (!file_exists($module_acp_filename))
		{
			$module_acp_filename = str_replace($phpbb_root_path, '/', $module_acp_filename);
			$access_module = false;
			$error[] = sprintf($user->lang['SN_ACP_MODULE_NOT_ACCESSIBLE'], $s_sn_module, $module_acp_filename);
		}
		// Exists module file for board?
		if (!file_exists($module_filename))
		{
			$module_filename = str_replace($phpbb_root_path, '/', $module_filename);
			$error[] = sprintf($user->lang['SN_MODULE_NOT_ACCESSIBLE'], $s_sn_module, $module_filename);
		} else
		{
			include($module_filename);
			if (!class_exists('socialnet_' . $module))
			{
				$error[] = sprintf($user->lang['SN_MODULE_NOT_EXISTS'], $module, $module_filename);
			}
		}

		// IF exist ACP function module try to load
		if ($access_module)
		{
			include($module_acp_filename);
			$acp_module = 'acp_' . $module;
			if (!class_exists($acp_module))
			{
				$error[] = $user->lang['ACP_PANEL_NOT_ACCESSIBLE'];
			} else
			{
				$modul = new $acp_module($this);
				$modul->main($id);
			}
		}
		$template->assign_vars(array(
			'S_ERROR'	 => (sizeof($error)) ? true : false,
			'ERROR_MSG'	 => implode('<br />', $error),
			'B_ACP_SN_' . strtoupper($module)			 => true
		));

		$this->acpPanel_title = isset($user->lang['ACP_SN_' . strtoupper($module) . '_SETTINGS']) ? $user->lang['ACP_SN_' . strtoupper($module) . '_SETTINGS'] : '{ ACP_SN_' . strtoupper($module) . '_SETTINGS }';
		$this->acpPanel_explain = sprintf($user->lang['ACP_SN_MODULE_SETTINGS_EXPLAIN'], isset($user->lang['SN_MODULE_' . strtoupper($module)]) ? $user->lang['SN_MODULE_' . strtoupper($module)] : '{ SN_MODULE_' . strtoupper($module) . ' }');

	}

	/**
	 * Turn on/off global use of Social Network
	 *
	 * Globální zapnutí či vypnutí Social Network<br />
	 * Pokud je potřeba v rámci jednotlivých modulů něco donastavit, bude zavolána funkce v rámci modulu <acp_modul>::acp_sett_main()
	 *
	 * @param integer $id phpBB variable
	 * @return void
	 */
	function sett_main($id)
	{
		global $db, $user, $template, $config, $cache, $socialnet_root_path, $phpEx;

		$this->acpPanel_explain = $user->lang['ACP_CAT_SOCIALNET_EXPLAIN'];

		$display_vars = array(
			'title'	 => 'SETTINGS',
			'vars'	 => array(
				'legend1'			 => 'SETTINGS',
				'sn_global_enable'	 => array('lang' => 'SN_GLOBAL_ENABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
			),
		);

		$cfg_array = request_var('config', array('' => ''), true);

		$enabled = isset($cfg_array['sn_global_enable']) ? $cfg_array['sn_global_enable'] : $config['sn_global_enable'];

		$new_value = $enabled ? '1' : '0';

		$cache->purge('modules_acp');
		$cache->purge('modules_ucp');

		$sql = "UPDATE " . MODULES_TABLE . "
				SET module_enabled = '{$new_value}'
				WHERE module_basename = 'socialnet'
					AND module_mode LIKE 'module_%'";
		$db->sql_query($sql);

		// Spustit dodatecne upravy, jednotlivych modulu
		$sql = "SELECT module_mode
				FROM " . MODULES_TABLE . "
				WHERE module_basename = 'socialnet'
					AND module_class = 'acp'
					AND module_mode LIKE 'module_%'";
		$rs = $db->sql_query($sql);
		$modules = $db->sql_fetchrowset($rs);
		$db->sql_freeresult($rs);

		for ($i = 0; $i < count($modules) && isset($modules[$i]); $i++)
		{
			$module = preg_replace('/^module_/si', '', $modules[$i]['module_mode']);
			$acp_filename = "{$socialnet_root_path}acp/acp_{$module}.{$phpEx}";
			if (file_exists($acp_filename))
			{
				include_once($acp_filename);
				$acp_moduleclass = 'acp_' . $module;
				if (method_exists($acp_moduleclass, 'acp_sett_main'))
				{
					eval("$acp_moduleclass::acp_sett_main();");
				}
			}
		}

		$this->_settings($id, 'sn_main', $display_vars);

		$this->_version_checker(array('host' => 'socialnetwork.phpbb3hacks.com', 'directory' => '', 'filename' => 'sn_modules.xml'));

		$this->acpPanel_explain = $user->lang['ACP_SN_WELCOME_TEXT'];
	}

	/**
	 * Configure which module of Social Network will be used
	 *
	 * Globální zapnutí či vypnutí jednotlivých modulů Social Network<br />
	 * Pokud je potřeba v rámci jednotlivých modulů něco donastavit, bude zavolána funkce v rámci modulu <acp_modul>::acp_sett_modules()
	 *
	 * @desc function take list available modules from SN_CONFIG_TABLE where config_name LIKE 'module_%'
	 * @param integer $id phpBB variable
	 * @return void
	 */
	function sett_modules($id)
	{
		global $config, $db, $user, $cache, $template, $socialnet_root_path, $phpEx;

		$sql = "SELECT * FROM " . SN_CONFIG_TABLE . " WHERE config_name LIKE 'module_%' ORDER BY config_name";

		$rs = $db->sql_query($sql);

		$modules = array();
		$modules['legend1'] = 'ACP_SN_AVAILABLE_MODULES';
		$module_current = array();
		while ($row = $db->sql_fetchrow($rs))
		{
			//$module_lang = 'SN_' . strtoupper(preg_replace( '/_([0-9])+_/si', '_', $row['config_name'])); // IF config_name of module is with number
			$module_current[$row['config_name']] = $row['config_value'];
			$module_lang = 'SN_' . strtoupper($row['config_name']) . '_NAME';
			$module_lang = isset($user->lang[$module_lang]) ? $module_lang : 'SN_' . strtoupper($row['config_name']);
			$modules[$row['config_name']] = array('lang' => $module_lang, 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true);
			$user->lang[$module_lang . '_EXPLAIN'] = sprintf($user->lang['SN_MODULE_EXPLAIN'], isset($user->lang[$module_lang]) ? $user->lang[$module_lang] : $module_lang);
		}

		$display_vars = array(
			'title'	 => 'ACP_BOARD_SETTINGS',
			'vars'	 => $modules
		);

		$cfg_array = request_var('config', array('' => ''), true);

		$cache->purge('modules_acp');
		$cache->purge('modules_ucp');

		foreach ($cfg_array as $module => $enabled)
		{
			$sql = "UPDATE " . MODULES_TABLE . "
							SET module_display = '{$enabled}'
							WHERE module_basename = 'socialnet'
								AND module_mode LIKE '{$module}%'";
			$db->sql_query($sql);

			if ($module_current[$module] != $enabled)
			{
				// Spustit dodatecne upravy, jednotlivych modulu pri zmene nastaveni
				$acp_moduleclass = 'acp_' . preg_replace('/^module_/si', '', $module);
				if (file_exists("{$socialnet_root_path}acp/{$acp_moduleclass}.{$phpEx}"))
				{
					include_once("{$socialnet_root_path}acp/{$acp_moduleclass}.{$phpEx}");
					if (method_exists($acp_moduleclass, 'acp_sett_modules'))
					{
						$module = new $acp_moduleclass($this);
						$module->acp_sett_modules($enabled);
					}
				}
			}
		}

		// We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to...
		$this->_settings($id, 'sn_modules', $display_vars);

		$this->acpPanel_title = $user->lang['ACP_SN_AVAILABLE_MODULES'] . ' ' . $user->lang['SETTINGS'];
		$this->acpPanel_explain = $user->lang['ACP_SN_AVAILABLE_MODULES_EXPLAIN'];
	}

	/**
	 * Nastavení pro Potvrzovací Box
	 *
	 * Potvrzovací Box je nedílnou součástí všech stránek při použití Social Network
	 *
	 * @param integer $id phpBB variable
	 * @return void
	 */
	function sett_confirmBox($id)
	{
		global $user;

		$this->acpPanel_title = $user->lang['ACP_SN_CONFIRMBOX_SETTINGS'];
		$this->acpPanel_explain = $user->lang['ACP_SN_CONFIRMBOX_SETTINGS_EXPLAIN'];

		$display_vars = array(
			'title'	 => 'ACP_SN_CONFIRMBOX_SETTINGS',
			'vars'	 => array(
				'legend1'			 => 'ACP_SN_CONFIRMBOX_SETTINGS',
				'sn_cb_enable'		 => array('lang' => 'SN_CB_ENABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
				'sn_cb_resizable'	 => array('lang' => 'SN_CB_RESIZABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
				'sn_cb_draggable'	 => array('lang' => 'SN_CB_DRAGGABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
				'sn_cb_modal'		 => array('lang' => 'SN_CB_MODAL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
				'sn_cb_width'		 => array('lang' => 'SN_CB_WIDTH', 'validate' => 'string', 'type' => 'text:4:6', 'explain' => true),
			)
		);

		$this->_settings($id, 'sn_cb', $display_vars);
	}

	/**
	 * Displays all admin settings for each acp panel
	 * @param mixed $id phpBB $id value
	 * @param string $mode Neccessary for log changes
	 * @param array $display_vars Standard $display_vars array to display configuration options
	 */
	function _settings($id, $mode, $display_vars = array())
	{
		global $db, $user, $auth, $template;
		global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
		global $cache;

		$form_key = 'acp_' . $mode . '_settings';
		add_form_key($form_key);

		$submit = (isset($_POST['submit'])) ? true : false;

		$display_vars = array_merge(array('title' => 'ACP_IM_SETTINGS'), $display_vars);

		if (isset($display_vars['lang']))
		{
			$user->add_lang($display_vars['lang']);
		}

		$this->new_config = $config;
		$cfg_array = (isset($_REQUEST['config'])) ? utf8_normalize_nfc(request_var('config', array('' => ''), true)) : $this->new_config;
		$error = array();

		// We validate the complete config if whished
		if (sizeOf($display_vars['vars']))
		{
			validate_config_vars($display_vars['vars'], $cfg_array, $error);
		}

		if ($submit && !check_form_key($form_key))
		{
			$error[] = $user->lang['FORM_INVALID'];
		}
		// Do not write values if there is an error
		if (sizeof($error))
		{
			$submit = false;
		}

		// We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to...
		if (sizeOf($display_vars['vars']))
		{
			foreach ($display_vars['vars'] as $config_name => $null)
			{
				if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false)
				{
					continue;
				}

				$this->new_config[$config_name] = $config_value = $cfg_array[$config_name];

				if ($submit)
				{
					$this->_set_config($config_name, $config_value);
				}
			}
		}

		if ($submit)
		{
			add_log('admin', 'LOG_CONFIG_' . strtoupper($mode));

			trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
		}

		$template->assign_vars(array(
			//'S_SETTINGS' => true,
			'S_ERROR'	 => (sizeof($error)) ? true : false,
			'ERROR_MSG'	 => implode('<br />', $error),

			'S_MODE'	 => $this->mode,
			'S_FOUNDER'	 => ($user->data['user_type'] == USER_FOUNDER) ? true : false,

			'U_ACTION'	 => $this->u_action));

		// Output relevant page
		if (sizeOf($display_vars['vars']))
		{
			foreach ($display_vars['vars'] as $config_key => $vars)
			{
				if (!is_array($vars) && strpos($config_key, 'legend') === false)
				{
					continue;
				}

				if (strpos($config_key, 'legend') !== false)
				{
					$template->assign_block_vars('options', array(
						'S_LEGEND'	 => true,
						'LEGEND'	 => (isset($user->lang[$vars])) ? $user->lang[$vars] : $vars));

					continue;
				}

				$type = explode(':', $vars['type']);

				$l_explain = '';
				if ($vars['explain'] && isset($vars['lang_explain']))
				{
					$l_explain = (isset($user->lang[$vars['lang_explain']])) ? $user->lang[$vars['lang_explain']] : $vars['lang_explain'];
				} else if ($vars['explain'])
				{
					$l_explain = (isset($user->lang[$vars['lang'] . '_EXPLAIN'])) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : '';
				}

				$content = build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars);

				if (empty($content))
				{
					continue;
				}

				$template->assign_block_vars('options', array(
					'KEY'			 => $config_key,
					'TITLE'			 => (isset($user->lang[$vars['lang']])) ? $user->lang[$vars['lang']] : $vars['lang'],
					'S_EXPLAIN'		 => $vars['explain'],
					'TITLE_EXPLAIN'	 => $l_explain,
					'CONTENT'		 => $content,
				));

				unset($display_vars['vars'][$config_key]);
			}
		}

	}

	/**
	 * Save configuration values into SOCIALNET CONFIG TABLE (SN_CONFIG_TABLE)
	 * @param string $config_name Config name
	 * @param mixed $config_value Configuration value
	 * @param boolean $is_dynamic Yes if dynamic configuration
	 * @return void
	 */
	function _set_config($config_name, $config_value, $is_dynamic = false)
	{
		global $db, $cache, $config;

		$sql = 'UPDATE ' . SN_CONFIG_TABLE . "
			SET config_value = '" . $db->sql_escape($config_value) . "'
			WHERE config_name = '" . $db->sql_escape($config_name) . "'";
		$db->sql_query($sql);

		if (!$db->sql_affectedrows() && !isset($config[$config_name]))
		{
			$sql = 'INSERT INTO ' . SN_CONFIG_TABLE . ' ' . $db->sql_build_array('INSERT', array(
				'config_name'	 => $config_name,
				'config_value'	 => $config_value,
				'is_dynamic'	 => ($is_dynamic) ? 1 : 0));
			$db->sql_query($sql);
		}

		$config[$config_name] = $config_value;

		if (!$is_dynamic)
		{
			$cache->destroy('config');
		}

	}

	function _version_checker($file)
	{
		global $config, $template;

		$update_xml = get_remote_file($file['host'], $file['directory'], $file['filename'], $errstr, $errno);

		if (!$update_xml)
		{
			$template->assign_var('B_COULD_NOT_GET_UPDATE', true);
			return;
		}

		if (version_compare(PHP_VERSION, '5.0.0', '<'))
		{
			$xml_data = $this->_setup_array($update_xml);
			$rows = $xml_data['modules'];
		} else
		{
			$xml_data = simplexml_load_string($update_xml);
			$rows = $this->_simpleXMLToArray($xml_data);

		}
		foreach ($rows['module'] as $idx => $module)
		{

			if ($idx == 0)
			{
				continue;
			}

			$code_name = $module["code"];
			$name = $module["name"];

			$version = $module["version"];

			$download = $module["download"];
			$pay = $module['pay'] ? true : false;

			$status = isset($config[$code_name]) || $code_name == 'socialNet' ? 1 : 0;
			if ($status == 1)
			{
				$status += version_compare(@$version, @$config['version_' . $code_name]);
			}

			$template->assign_block_vars('avail_module', array(
				'CODE_NAME'			 => $code_name,
				'NAME'				 => isset($user->lang[$name]) ? $user->lang[$name] : $name,
				'VERSION'			 => $version,
				'STATUS'			 => $status,
				'INSTALLED_VERSION'	 => ($code_name == 'module_core') ? $config['version_socialNet'] : @$config['version_' . $code_name],
				'DOWNLOAD'			 => $download,
				'B_PAY'				 => $pay,
			));
		}

	}

	/**
	 * XML parser
	 *
	 * Rozparsování xml souboru do pole
	 * Převzato z {@link http://startrekguide.com/community/viewtopic.php?f=87&t=3584 [MODDB]MOD Version Check 1.0.2}
	 * Pro PHP < 5.0.0
	 *
	 * @param string $xml XML data
	 * @param boolean $get_attributes Vrátit atributy xml tagů
	 * @param string $priority
	 */
	function _setup_array($xml, $get_attributes = 1, $priority = 'tag')
	{
		$parser = xml_parser_create('');
		if (!$parser)
			return false;

		xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, 'UTF-8');
		xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
		xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
		xml_parse_into_struct($parser, trim($xml), $xml_values);
		xml_parser_free($parser);
		if (!$xml_values)
			return array();

		$xml_array = array();
		$parents = array();
		$opened_tags = array();
		$arr = array();
		$current =& $xml_array;
		$repeated_tag_index = array();
		foreach ($xml_values as $data)
		{
			unset($attributes, $value);
			extract($data);
			$result = array();
			$attributes_data = array();
			if (isset($value))
			{
				if ($priority == 'tag')
					$result = $value;
				else
					$result['value'] = $value;
			}
			if (isset($attributes) and $get_attributes)
			{
				foreach ($attributes as $attr => $val)
				{
					if ($priority == 'tag')
						$attributes_data[$attr] = $val;
					else
						$result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr'
					}
			}
			if ($type == "open")
			{
				$parent[$level - 1] =& $current;
				if (!is_array($current) or (!in_array($tag, array_keys($current))))
				{
					$current[$tag] = $result;
					if ($attributes_data)
						$current[$tag . '_attr'] = $attributes_data;
					$repeated_tag_index[$tag . '_' . $level] = 1;
					$current =& $current[$tag];
				} else
				{
					if (isset($current[$tag][0]))
					{
						$current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result;
						$repeated_tag_index[$tag . '_' . $level]++;
					} else
					{
						$current[$tag] = array(
							$current[$tag],
							$result
						);
						$repeated_tag_index[$tag . '_' . $level] = 2;
						if (isset($current[$tag . '_attr']))
						{
							$current[$tag]['0_attr'] = $current[$tag . '_attr'];
							unset($current[$tag . '_attr']);
						}
					}
					$last_item_index = $repeated_tag_index[$tag . '_' . $level] - 1;
					$current =& $current[$tag][$last_item_index];
				}
			} elseif ($type == "complete")
			{
				if (!isset($current[$tag]))
				{
					$current[$tag] = $result;
					$repeated_tag_index[$tag . '_' . $level] = 1;
					if ($priority == 'tag' and $attributes_data)
						$current[$tag . '_attr'] = $attributes_data;
				} else
				{
					if (isset($current[$tag][0]) and is_array($current[$tag]))
					{
						$current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result;
						if ($priority == 'tag' and $get_attributes and $attributes_data)
						{
							$current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data;
						}
						$repeated_tag_index[$tag . '_' . $level]++;
					} else
					{
						$current[$tag] = array(
							$current[$tag],
							$result
						);
						$repeated_tag_index[$tag . '_' . $level] = 1;
						if ($priority == 'tag' and $get_attributes)
						{
							if (isset($current[$tag . '_attr']))
							{
								$current[$tag]['0_attr'] = $current[$tag . '_attr'];
								unset($current[$tag . '_attr']);
							}
							if ($attributes_data)
							{
								$current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data;
							}
						}
						$repeated_tag_index[$tag . '_' . $level]++; //0 and 1 index is already taken
						}
				}
			} elseif ($type == 'close')
			{
				$current =& $parent[$level - 1];
			}
		}
		return ($xml_array);
	}

	/**
	 * Converts a simpleXML element into an array. Preserves attributes and everything.
	 * You can choose to get your elements either flattened, or stored in a custom index that
	 * you define.
	 * For example, for a given element
	 * <field name="someName" type="someType"/>
	 * if you choose to flatten attributes, you would get:
	 * $array['field']['name'] = 'someName';
	 * $array['field']['type'] = 'someType';
	 * If you choose not to flatten, you get:
	 * $array['field']['@attributes']['name'] = 'someName';
	 * _____________________________________
	 * Repeating fields are stored in indexed arrays. so for a markup such as:
	 * <parent>
	 * <child>a</child>
	 * <child>b</child>
	 * <child>c</child>
	 * </parent>
	 * you array would be:
	 * $array['parent']['child'][0] = 'a';
	 * $array['parent']['child'][1] = 'b';
	 * ...And so on.
	 * _____________________________________
	 * @param simpleXMLElement $xml the XML to convert
	 * @param boolean $flattenValues    Choose wether to flatten values
	 *                                    or to set them under a particular index.
	 *                                    defaults to true;
	 * @param boolean $flattenAttributes Choose wether to flatten attributes
	 *                                    or to set them under a particular index.
	 *                                    Defaults to true;
	 * @param boolean $flattenChildren    Choose wether to flatten children
	 *                                    or to set them under a particular index.
	 *                                    Defaults to true;
	 * @param string $valueKey            index for values, in case $flattenValues was set to
	 *                            false. Defaults to "@value"
	 * @param string $attributesKey        index for attributes, in case $flattenAttributes was set to
	 *                            false. Defaults to "@attributes"
	 * @param string $childrenKey        index for children, in case $flattenChildren was set to
	 *                            false. Defaults to "@children"
	 * @return array the resulting array.
	 */
	function _simpleXMLToArray($xml, $flattenValues = true, $flattenAttributes = true, $flattenChildren = true, $valueKey = '@value', $attributesKey = '@attributes', $childrenKey = '@children')
	{

		$return = array();
		if (!($xml instanceof SimpleXMLElement))
		{
			return $return;
		}
		$name = $xml->getName();
		$_value = trim((string) $xml);
		if (strlen($_value) == 0)
		{
			$_value = null;
		}
		;

		if ($_value !== null)
		{
			if (!$flattenValues)
			{
				$return[$valueKey] = $_value;
			} else
			{
				$return = $_value;
			}
		}

		$children = array();
		$first = true;
		foreach ($xml->children() as $elementName => $child)
		{
			$value = $this->_simpleXMLToArray($child, $flattenValues, $flattenAttributes, $flattenChildren, $valueKey, $attributesKey, $childrenKey);
			if (isset($children[$elementName]))
			{
				if ($first)
				{
					$temp = $children[$elementName];
					unset($children[$elementName]);
					$children[$elementName][] = $temp;
					$first = false;
				}
				$children[$elementName][] = $value;
			} else
			{
				$children[$elementName] = $value;
			}
		}
		if (count($children) > 0)
		{
			if (!$flattenChildren)
			{
				$return[$childrenKey] = $children;
			} else
			{
				$return = array_merge($return, $children);
			}
		}

		$attributes = array();
		foreach ($xml->attributes() as $name => $value)
		{
			$attributes[$name] = trim($value);
		}
		if (count($attributes) > 0)
		{
			if (!$flattenAttributes)
			{
				$return[$attributesKey] = $attributes;
			} else
			{
				$return = array_merge($return, $attributes);
			}
		}

		return $return;
	}
}

?>
can you help me?
thanks
Akshay2598
Registered User
Posts: 241
Joined: Tue Jun 21, 2011 5:35 pm
Contact:

Re: [RC] phpBB3 Social Network 0.6.0

Post by Akshay2598 »

Looking forward to new version
User avatar
Alien_Time
Registered User
Posts: 389
Joined: Fri Dec 31, 2010 7:08 am

Re: [RC] phpBB3 Social Network 0.6.0

Post by Alien_Time »

Hi Kamahl19,

Thats a great news!! Thanx for the update!

Also, can anyone help me on my problem I had posted before plz....I have been searching and I still cant find a solution for this..If there is a solution and I missed it, can you plz give me the links...
My problem is: When you go to the mainpage.php (when you are logged-in), you can see everything as its supposed to be. Everything works including the Chat. However, under the "FRIENDS ONLINE" heading (on the left side in the mainpage), there are no contents and its just empty. I understand that it wont show anything if the friends are not online. But in this case it should atleast show "No online user"..Also I have noticed that it is still empty even if there are users online. But the chat still works and I am able to chat to the other users as well! Any idea on why this is happening? I have installed the mod and everything else seems to be working so far..still on the testing stage...
idontwantausername
Registered User
Posts: 219
Joined: Fri Nov 09, 2007 8:25 pm

Re: [RC] phpBB3 Social Network 0.6.0

Post by idontwantausername »

Image

for some reason the page looks like this. I've purged the Cache and refreshed the templates etc. Dnt know what's up

edit: fixed, copied a line wrong
Private6
Registered User
Posts: 19
Joined: Sat Dec 04, 2010 7:00 pm

Re: [RC] phpBB3 Social Network 0.6.0

Post by Private6 »

I'm getting an error at the installation point, I'm running a dutch phpbb3 forum.

Can someone please help... This mod looks so cool!

Link:
http://i56.tinypic.com/2qlhlw4.png
idontwantausername
Registered User
Posts: 219
Joined: Fri Nov 09, 2007 8:25 pm

Re: [RC] phpBB3 Social Network 0.6.0

Post by idontwantausername »

idontwantausername wrote:Image

for some reason the page looks like this. I've purged the Cache and refreshed the templates etc. Dnt know what's up

edit: fixed, copied a line wrong
Hm seems this still appears like this in IE and Chrome, looks fine in firefox, but looks dodgy in chrome and IE.
rayminator
Registered User
Posts: 310
Joined: Wed Nov 15, 2006 1:37 pm
Name: raymond green
Contact:

Re: [RC] phpBB3 Social Network 0.6.0

Post by rayminator »

i have installed this phpbb 3.0.9

and i am getting this error when i try to install

Index name 'phpbb_socialnet_im_chatboxes_idx_chatbox' on table 'phpbb_socialnet_im_chatboxes' is too long. The maximum is 24 characters.
Akshay2598
Registered User
Posts: 241
Joined: Tue Jun 21, 2011 5:35 pm
Contact:

Re: [RC] phpBB3 Social Network 0.6.0

Post by Akshay2598 »

The index in the mysql databse in that table is too long. Do a backup, then delet it see what happens. If it works great. If it doesn't.. your screwed for LIFE.. wait i forgot you had the backup. Restore the database XD
Locked

Return to “[3.0.x] Abandoned MODs”