MyBB Community Forums

Full Version: welcome message for guest
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
hello
i want to add this code to my forum
<div class="table-wrap">
<div class="table-cell-mid">
<h1 class="white">Welcome to Anonshare</h1>
Create a free account today and:
<ul>
<li>Discuss with <span class="white">{$stats['numusers']}</span> other members in <span class="white">{$stats['numthreads']}</span> topics.</li>
<li>Browse through <span class="white">{$stats['numposts']}</span> posts.</li>
</ul>
</div>
<div class="table-cell-mid guest-notice-button-col">
<a href="/member.php?action=register"><button class="guest-notice-button-register"><link class="rippleJS">Create an account</button></a>
<div class="spacer-bottom-10"></div>
<a href="/member.php"><button class="guest-notice-button"><link class="rippleJS">Login to account</button></a>
</div>
</div>
but how can i make it only for guests?
You can add this code in header_welcomeblock_guest template.
Modify your header template so that you can use both header_welcomeblock_guest and header_welcomeblock_member template.

Regards
WallBB
Or you could use and or keep working on this [attachment=42477]


As I assume you already have the css styled for your snippet the rest should work fine for this plug and i dont have your css or your stats plug, just added your provuded snippet on how it could be done in a basic plug for guests on index and portal. It is localized but I only provided english initial lang files. Best of luck.

[Image: Screenshot-20200118-114757-Firefox.jpg]

[Image: Screenshot-20200118-114813-Firefox.jpg]

[Image: Screenshot-20200118-124049-Firefox.jpg]

inc/plugins/anonshare_welcomeguest.php
<?php
/*
 * MyBB: AnonShare Welcome Guest
 *
 * File: anonshare_welcomeguest.php
 * 
 * Author: Vintagedaddyo
 *
 * MyBB Version: 1.8
 *
 * Plugin Version: 1.0
 *
 * 
 */

// Disallow direct access to this file for security reasons

if(!defined("IN_MYBB"))
{
    die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}

$plugins->add_hook('index_start','anonshare_welcomeguest');
$plugins->add_hook('portal_start','anonshare_welcomeguest');

function anonshare_welcomeguest_info()
{
   global $lang;

    $lang->load("anonshare_welcomeguest");
    
    $lang->anonshare_welcomeguest_Desc = '<form action="https://www.paypal.com/cgi-bin/webscr" method="post" style="float:right;">' .
        '<input type="hidden" name="cmd" value="_s-xclick">' . 
        '<input type="hidden" name="hosted_button_id" value="AZE6ZNZPBPVUL">' .
        '<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">' .
        '<img alt="" border="0" src="https://www.paypalobjects.com/pl_PL/i/scr/pixel.gif" width="1" height="1">' .
        '</form>' . $lang->anonshare_welcomeguest_Desc;

    return Array(
        'name' => $lang->anonshare_welcomeguest_Name,
        'description' => $lang->anonshare_welcomeguest_Desc,
        'website' => $lang->anonshare_welcomeguest_Web,
        'author' => $lang->anonshare_welcomeguest_Auth,
        'authorsite' => $lang->anonshare_welcomeguest_AuthSite,
        'version' => $lang->anonshare_welcomeguest_Ver,
        'compatibility' => $lang->anonshare_welcomeguest_Compat
    );
}

function anonshare_welcomeguest_activate()
{
	require_once MYBB_ROOT.'/inc/adminfunctions_templates.php';
	find_replace_templatesets('index','#'.preg_quote('{$anonshare_welcomeguest}
').'#i','',0);
	find_replace_templatesets('portal','#'.preg_quote('{$anonshare_welcomeguest}
').'#i','',0);
	find_replace_templatesets('index','#'.preg_quote('{$forums}').'#i','{$anonshare_welcomeguest}
{$forums}');
	find_replace_templatesets('portal','#'.preg_quote('{$announcements}').'#i','{$anonshare_welcomeguest}
{$announcements}');
}

function anonshare_welcomeguest_deactivate()
{
	require_once MYBB_ROOT.'/inc/adminfunctions_templates.php';
	find_replace_templatesets('index','#'.preg_quote('{$anonshare_welcomeguest}
').'#i','',0);
	find_replace_templatesets('portal','#'.preg_quote('{$anonshare_welcomeguest}
').'#i','',0);
}

function anonshare_welcomeguest_lang()
{
	global $lang;
	$lang->load("anonshare_welcomeguest");
}

function anonshare_welcomeguest()
{
	global $mybb;

	if($mybb->user['usergroup']==1)
	{
		global $theme,$lang,$anonshare_welcomeguest;
		
		anonshare_welcomeguest_lang();
		
		$anonshare_welcomeguest='<div class="table-wrap">
    <div class="table-cell-mid">
        <h1 class="white">'.$lang->anonshare_welcomeguest_hello.'</h1>
        '.$lang->anonshare_welcomeguest_create.'
        <ul>
            <li>'.$lang->anonshare_welcomeguest_discuss.' <span class="white">'.$stats['numusers'].'</span>'.$lang->anonshare_welcomeguest_othermembers.'<span class="white">'.$stats['numthreads'].'</span>'.$lang->anonshare_welcomeguest_topics.'</li>
            <li>'.$lang->anonshare_welcomeguest_browse.' <span class="white">'.$stats['numposts'].'</span>'.$lang->anonshare_welcomeguest_posts.'</li>
        </ul>
    </div>
    <div class="table-cell-mid guest-notice-button-col">
        <a href="member.php?action=register">
         <button class="guest-notice-button-register">
            <link class="rippleJS">
            '.$lang->anonshare_welcomeguest_createacct.'
         </button>
      </a>
        <div class="spacer-bottom-10"></div>
        <a href="member.php">
         <button class="guest-notice-button">
            <link class="rippleJS">
            '.$lang->anonshare_welcomeguest_loginacct.'
         </button>
      </a>
    </div>
</div>';
	}
}

?>

inc/languages/english/anonshare_welcomeguest.lang.php
<?php
/*
 * MyBB: AnonShare Welcome Guest
 *
 * File: anonshare_welcomeguest.lang.php
 * 
 * Author: Vintagedaddyo
 *
 * MyBB Version: 1.8
 *
 * Plugin Version: 1.0
 * 
 */


// anonshare_welcomeguest_lang_setting

$l['anonshare_welcomeguest_hello']='Welcome to Anonshare!';

$l['anonshare_welcomeguest_create']='Create a free account today and:';

$l['anonshare_welcomeguest_discuss']='Discuss with: ';

$l['anonshare_welcomeguest_othermembers']='other members in: ';

$l['anonshare_welcomeguest_topics']=' topics.';

$l['anonshare_welcomeguest_browse']='Browse through: ';

$l['anonshare_welcomeguest_posts']=' posts.';

$l['anonshare_welcomeguest_createacct']='Create an account';

$l['anonshare_welcomeguest_loginacct']='Login to account';

?>


inc/languages/engish/admin/anonshare_welcomeguest.lang.php
<?php
/*
 * MyBB: AnonShare Welcome Guest
 *
 * File: anonshare_welcomeguest.lang.php
 * 
 * Author: Vintagedaddyo
 *
 * MyBB Version: 1.8
 *
 * Plugin Version: 1.0
 * 
 */

// anonshare_welcomeguest_plugin_info

$l['anonshare_welcomeguest_Name'] = 'AnonShare Welcome Guest';
$l['anonshare_welcomeguest_Desc'] = 'Shows a welcome box to AnonShare guests on index and portal page.';
$l['anonshare_welcomeguest_Web'] = 'http://community.mybb.com/user-6029.html';
$l['anonshare_welcomeguest_Auth'] = 'Vintagedaddyo';
$l['anonshare_welcomeguest_AuthSite'] = 'http://community.mybb.com/user-6029.html';
$l['anonshare_welcomeguest_Ver'] = '1.0';
$l['anonshare_welcomeguest_GUID'] = '';
$l['anonshare_welcomeguest_Compat'] = '18*';

?>

* I mean I could have injected a stylesheet but I don't have your css that goes with the snippet you provided and my time is limited. And since you are only using the one theme I figured you would just include whatever corresponding css in that theme. Wink

Ideally thus eas provided as a starting point for you to modify to your desires. Anyhoo, just a basic example of a minor modify using existing theme for example sake:

[Image: Screenshot-20200118-152030-Firefox.jpg]

[Image: Screenshot-20200118-151933-Firefox.jpg]


All this basic modify example does is comment out top guest buttons here:

header_welcomeblock_guest
<!--
<span style="color:white;"><strong>Not a member yet? Why not Sign up today </strong></span>

<br />

<a class="button login" href="{$mybb->settings['bburl']}/member.php?action=login" onclick="$('#quick_login').modal({ fadeDuration: 250, keepelement: true }); return false;"><font color="white"><i style="font-size: 16px;" class="fa fa-check-circle-o fa-fw"></i> Login to account</font></a> 

<a class="button2 register" href="{$mybb->settings['bburl']}/member.php?action=register"><font color="white"><i style="font-size: 16px;" class="fa fa-plus-circle fa-fw"></i>  Create an account &nbsp;</font></a>
-->


Then a quick little modify of 2 plugin files:


inc/plugins/anonshare_welcomeguest.php
<?php
/*
 * MyBB: AnonShare Welcome Guest
 *
 * File: anonshare_welcomeguest.php
 * 
 * Author: Vintagedaddyo
 *
 * MyBB Version: 1.8
 *
 * Plugin Version: 1.0
 *
 * 
 */

// Disallow direct access to this file for security reasons

if(!defined("IN_MYBB"))
{
    die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}

$plugins->add_hook('index_start','anonshare_welcomeguest');
$plugins->add_hook('portal_start','anonshare_welcomeguest');

function anonshare_welcomeguest_info()
{
   global $lang;

    $lang->load("anonshare_welcomeguest");
    
    $lang->anonshare_welcomeguest_Desc = '<form action="https://www.paypal.com/cgi-bin/webscr" method="post" style="float:right;">' .
        '<input type="hidden" name="cmd" value="_s-xclick">' . 
        '<input type="hidden" name="hosted_button_id" value="AZE6ZNZPBPVUL">' .
        '<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">' .
        '<img alt="" border="0" src="https://www.paypalobjects.com/pl_PL/i/scr/pixel.gif" width="1" height="1">' .
        '</form>' . $lang->anonshare_welcomeguest_Desc;

    return Array(
        'name' => $lang->anonshare_welcomeguest_Name,
        'description' => $lang->anonshare_welcomeguest_Desc,
        'website' => $lang->anonshare_welcomeguest_Web,
        'author' => $lang->anonshare_welcomeguest_Auth,
        'authorsite' => $lang->anonshare_welcomeguest_AuthSite,
        'version' => $lang->anonshare_welcomeguest_Ver,
        'compatibility' => $lang->anonshare_welcomeguest_Compat
    );
}

function anonshare_welcomeguest_activate()
{
	require_once MYBB_ROOT.'/inc/adminfunctions_templates.php';
	find_replace_templatesets('index','#'.preg_quote('{$anonshare_welcomeguest}
').'#i','',0);
	find_replace_templatesets('portal','#'.preg_quote('{$anonshare_welcomeguest}
').'#i','',0);
	find_replace_templatesets('index','#'.preg_quote('{$forums}').'#i','{$anonshare_welcomeguest}
{$forums}');
	find_replace_templatesets('portal','#'.preg_quote('{$announcements}').'#i','{$anonshare_welcomeguest}
{$announcements}');
}

function anonshare_welcomeguest_deactivate()
{
	require_once MYBB_ROOT.'/inc/adminfunctions_templates.php';
	find_replace_templatesets('index','#'.preg_quote('{$anonshare_welcomeguest}
').'#i','',0);
	find_replace_templatesets('portal','#'.preg_quote('{$anonshare_welcomeguest}
').'#i','',0);
}

function anonshare_welcomeguest_lang()
{
	global $lang;
	$lang->load("anonshare_welcomeguest");
}

function anonshare_welcomeguest()
{
	global $mybb;

	if($mybb->user['usergroup']==1)
	{
		global $theme,$lang,$anonshare_welcomeguest;
		
		anonshare_welcomeguest_lang();
		
		$anonshare_welcomeguest='<table border="0" cellspacing="'.$theme['borderwidth'].'" cellpadding="'.$theme['tablespace'].'" class="tborder">
	<thead>
		<tr>
			<td class="thead">
				<strong>'.$lang->anonshare_welcomeguest_hello.'</strong>
			</td>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td class="trow1">
		
		<div class="float_left"><span style="color: #ffffff; font-size: 14px;"><strong><h1>'.$lang->anonshare_welcomeguest_shout.'</h1>
 '.$lang->anonshare_welcomeguest_create.'
        <ul>
            <li>'.$lang->anonshare_welcomeguest_discuss.' '.$stats['numusers'].''.$lang->anonshare_welcomeguest_othermembers.''.$stats['numthreads'].''.$lang->anonshare_welcomeguest_topics.'</li>
            <li>'.$lang->anonshare_welcomeguest_browse.''.$stats['numposts'].''.$lang->anonshare_welcomeguest_posts.'</li>
        </ul>
    </strong>
    </span>
    </div>
    <br />
 <div class="float_right">   
 <span style="color:#ffffff;"><strong>'.$lang->anonshare_welcomeguest_question.' </strong></span>
<br />
        <a class="button2 register" href="'.$mybb->settings['bburl'].'/member.php?action=register"><font color="white"><i style="font-size: 16px;" class="fa fa-plus-circle fa-fw"></i> 
            '.$lang->anonshare_welcomeguest_createacct.'
         </font>
      </a>
        <a class="button login" href="'.$mybb->settings['bburl'].'/member.php?action=login"onclick="$(\'#quick_login\').modal({ fadeDuration: 250, keepelement: true }); return false;"><font color="white"><i style="font-size: 16px;" class="fa fa-check-circle-o fa-fw"></i> '.$lang->anonshare_welcomeguest_loginacct.'</font>
      </a>
    </div>
    <br />
    </td>
		</tr>
	</tbody>
</table>
<br />';
	}
}

?>

inc/languages/english/anonshare_welcomeguest.lang.php
<?php
/*
 * MyBB: AnonShare Welcome Guest
 *
 * File: anonshare_welcomeguest.lang.php
 * 
 * Author: Vintagedaddyo
 *
 * MyBB Version: 1.8
 *
 * Plugin Version: 1.0
 * 
 */


// anonshare_welcomeguest_lang_setting

$l['anonshare_welcomeguest_hello']='Welcome to Anonshare!';

$l['anonshare_welcomeguest_shout']='Greetings, Guest...';

$l['anonshare_welcomeguest_create']='Create a free account today and:';

$l['anonshare_welcomeguest_discuss']='Discuss with: ';

$l['anonshare_welcomeguest_othermembers']='other members in: ';

$l['anonshare_welcomeguest_topics']=' topics.';

$l['anonshare_welcomeguest_browse']='Browse through: ';

$l['anonshare_welcomeguest_posts']=' posts.';

$l['anonshare_welcomeguest_createacct']='Create an account';

$l['anonshare_welcomeguest_loginacct']='Login to account';

$l['anonshare_welcomeguest_question']='Not a member yet? Why not Sign up today';

?>


Again this is just to show you that by using what I provided as a base starting point  you can modify it to your own desired usages whether simple or complicated.

Like then going on to put a bg image

[Image: Screenshot-20200118-154814-Firefox.jpg]

Tweak fonts, tweak font sizing and expand on it, maybe expand the message, and say expand upon further with say other things you want to add like whatever you are planning with stats calls and whatever else. Hopefully this just got your creative process heading somewgere with it. Wink
i dont want to add it at the header cause i am gonna make a css for it and it doesnt looks good there.
i made some changes
<div class="table-wrapanon">
<div class="table-cell-midanon">
<h1 class="white">Welcome to Anonshare</h1>
Create a free account today and:
<ul>
<li>Discuss with  {$stats['numusers']} other members in <span class="white">{$stats['numthreads']}</span> topics.</li>
<li>Browse through <span class="white">{$stats['numposts']}</span> posts.</li>
</ul>
</div>
<div class="table-cell-midanon guest-notice-button-col">
<p><a class="button login" href="{$mybb->settings['bburl']}/member.php?action=login" onclick="$('#quick_login').modal({ fadeDuration: 250, keepelement: true }); return false;"><font color="white"><i style="font-size: 16px;" class="fa fa-check-circle-o fa-fw"></i> Login to account</font></a></p>
<p><a class="button2 register" href="{$mybb->settings['bburl']}/member.php?action=register"><font color="white"><i style="font-size: 16px;" class="fa fa-plus-circle fa-fw"></i>  Create an account &nbsp;</font></a></p>
</div>
</div>

css(i am gonna change the colors and borders)
.table-wrapanon {
    display: table;
    width: 100%;
    table-layout: fixed;
    border-radius: 0px; top: 0; right: 0; padding: 8px;
    background:rgba(22, 160, 133,0.7);
    color:#FFF;
    margin-bottom: 4px;
    text-align: center;
}
.table-cell-midanon {
    display: table-cell;
    vertical-align: middle;
}

1-i want to add it where my announcment are and i want to make my announcment visible only at members.
2-if you have noticed i have these in my html
{$stats['numusers']} number of members
{$stats['numthreads']} number of threads
{$stats['numposts']} number of posts
but it doesnt show the numbers
Don't really have much free time nor want to spend much time on this as it was provided as a base to start from, but yeah I assume you mean these displaying like so or what not

[Image: Screenshot-20200118-190256-Firefox.jpg]

Open global.php and find:

$plugins->run_hooks('global_start');

Add directly after

// start stats global for welcome

$stats = $cache->read("stats");
$stats['newest_user'] = build_profile_link($stats['lastusername'], $stats['lastuid']);
$total_posts = my_number_format($stats['numposts']);
$total_users = my_number_format($stats['numusers']);

// end stats global


Change the previous shared plugin file to

inc/plugins/anonshare_welcomeguest.php

<?php
/*
 * MyBB: AnonShare Welcome Guest
 *
 * File: anonshare_welcomeguest.php
 * 
 * Author: Vintagedaddyo
 *
 * MyBB Version: 1.8
 *
 * Plugin Version: 1.0
 *
 * 
 */

// Disallow direct access to this file for security reasons

if(!defined("IN_MYBB"))
{
    die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}

$plugins->add_hook('global_start','anonshare_welcomeguest');

$plugins->add_hook('index_start','anonshare_welcomeguest');
$plugins->add_hook('portal_start','anonshare_welcomeguest');

function anonshare_welcomeguest_info()
{
   global $lang;

    $lang->load("anonshare_welcomeguest");
    
    $lang->anonshare_welcomeguest_Desc = '<form action="https://www.paypal.com/cgi-bin/webscr" method="post" style="float:right;">' .
        '<input type="hidden" name="cmd" value="_s-xclick">' . 
        '<input type="hidden" name="hosted_button_id" value="AZE6ZNZPBPVUL">' .
        '<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">' .
        '<img alt="" border="0" src="https://www.paypalobjects.com/pl_PL/i/scr/pixel.gif" width="1" height="1">' .
        '</form>' . $lang->anonshare_welcomeguest_Desc;

    return Array(
        'name' => $lang->anonshare_welcomeguest_Name,
        'description' => $lang->anonshare_welcomeguest_Desc,
        'website' => $lang->anonshare_welcomeguest_Web,
        'author' => $lang->anonshare_welcomeguest_Auth,
        'authorsite' => $lang->anonshare_welcomeguest_AuthSite,
        'version' => $lang->anonshare_welcomeguest_Ver,
        'compatibility' => $lang->anonshare_welcomeguest_Compat
    );
}

function anonshare_welcomeguest_activate()
{
	require_once MYBB_ROOT.'/inc/adminfunctions_templates.php';
	find_replace_templatesets('index','#'.preg_quote('{$anonshare_welcomeguest}
').'#i','',0);
	find_replace_templatesets('portal','#'.preg_quote('{$anonshare_welcomeguest}
').'#i','',0);
	find_replace_templatesets('index','#'.preg_quote('{$forums}').'#i','{$anonshare_welcomeguest}
{$forums}');
	find_replace_templatesets('portal','#'.preg_quote('{$announcements}').'#i','{$anonshare_welcomeguest}
{$announcements}');
}

function anonshare_welcomeguest_deactivate()
{
	require_once MYBB_ROOT.'/inc/adminfunctions_templates.php';
	find_replace_templatesets('index','#'.preg_quote('{$anonshare_welcomeguest}
').'#i','',0);
	find_replace_templatesets('portal','#'.preg_quote('{$anonshare_welcomeguest}
').'#i','',0);
}

function anonshare_welcomeguest_lang()
{
	global $lang;
	$lang->load("anonshare_welcomeguest");
}

function anonshare_welcomeguest()
{
	global $mybb;

	if($mybb->user['usergroup']==1)
	{
		global $theme,$lang,$anonshare_welcomeguest,$stats;
		
		
		anonshare_welcomeguest_lang();
		
		$anonshare_welcomeguest='
		<style>
		.trow1.body1 { 	background: #161616 url(\'images/igame/trow1-body1.png\') no-repeat 50% 50%; 	background-size: cover; 	min-height: 220px; }
		</style>
		<table border="0" cellspacing="'.$theme['borderwidth'].'" cellpadding="'.$theme['tablespace'].'" class="tborder">
	<thead>
		<tr>
			<td class="thead">
				<strong>'.$lang->anonshare_welcomeguest_hello.'</strong>
			</td>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td class="trow1 body1">
		<div class="float_left"><span style="color: #ffffff; font-size: 14px;"><strong><h1>'.$lang->anonshare_welcomeguest_shout.'</h1>
 '.$lang->anonshare_welcomeguest_create.'
        <ul>
            <li>'.$lang->anonshare_welcomeguest_discuss.' <span style="color: #3f9889;">'.$stats['numusers'].'</span> '.$lang->anonshare_welcomeguest_othermembers.'<span style="color: #3f9889;">'.$stats['numthreads'].'</span>'.$lang->anonshare_welcomeguest_topics.'</li>
            <li>'.$lang->anonshare_welcomeguest_browse.'<span style="color: #3f9889;">'.$stats['numposts'].'</span>'.$lang->anonshare_welcomeguest_posts.'</li>
        </ul>
    </strong>
    </span>
    </div>
    <br />
 <div class="float_right">   
 <span style="color:#ffffff;"><strong>'.$lang->anonshare_welcomeguest_question.' </strong></span>
<br />
        <a class="button2 register" href="'.$mybb->settings['bburl'].'/member.php?action=register"><font color="white"><i style="font-size: 16px;" class="fa fa-plus-circle fa-fw"></i> 
            '.$lang->anonshare_welcomeguest_createacct.'
         </font>
      </a>
        <a class="button login" href="'.$mybb->settings['bburl'].'/member.php?action=login"onclick="$(\'#quick_login\').modal({ fadeDuration: 250, keepelement: true }); return false;"><font color="white"><i style="font-size: 16px;" class="fa fa-check-circle-o fa-fw"></i> '.$lang->anonshare_welcomeguest_loginacct.'</font>
      </a>
    </div>
    <br />
    </td>
		</tr>
	</tbody>
</table>
<br />';
	}
}

?>

inc/languages/english/anonshare_welcomeguest.lang.php
<?php
/*
 * MyBB: AnonShare Welcome Guest
 *
 * File: anonshare_welcomeguest.lang.php
 * 
 * Author: Vintagedaddyo
 *
 * MyBB Version: 1.8
 *
 * Plugin Version: 1.0
 * 
 */


// anonshare_welcomeguest_lang_setting

$l['anonshare_welcomeguest_hello']='Welcome to Anonshare!';

$l['anonshare_welcomeguest_shout']='Greetings, Guest...';

$l['anonshare_welcomeguest_create']='Create a free account today and:';

$l['anonshare_welcomeguest_discuss']='Discuss with: ';

$l['anonshare_welcomeguest_othermembers']='other members in: ';

$l['anonshare_welcomeguest_topics']=' topics.';

$l['anonshare_welcomeguest_browse']='Browse through: ';

$l['anonshare_welcomeguest_posts']=' posts.';

$l['anonshare_welcomeguest_createacct']='Create an account';

$l['anonshare_welcomeguest_loginacct']='Login to account';

$l['anonshare_welcomeguest_question']='Not a member yet? Why not Sign up today';

?>


inc/languages/english/admin/anonshare_welcomeguest.lang.php
<?php
/*
 * MyBB: AnonShare Welcome Guest
 *
 * File: anonshare_welcomeguest.lang.php
 * 
 * Author: Vintagedaddyo
 *
 * MyBB Version: 1.8
 *
 * Plugin Version: 1.0
 * 
 */

// anonshare_welcomeguest_plugin_info

$l['anonshare_welcomeguest_Name'] = 'AnonShare Welcome Guest';
$l['anonshare_welcomeguest_Desc'] = 'Shows a welcome box to AnonShare guests on index and portal page.';
$l['anonshare_welcomeguest_Web'] = 'http://community.mybb.com/user-6029.html';
$l['anonshare_welcomeguest_Auth'] = 'Vintagedaddyo';
$l['anonshare_welcomeguest_AuthSite'] = 'http://community.mybb.com/user-6029.html';
$l['anonshare_welcomeguest_Ver'] = '1.0';
$l['anonshare_welcomeguest_GUID'] = '';
$l['anonshare_welcomeguest_Compat'] = '18*';

?>


comment out the following in igame header_welcomeblock_guest
<!--
<span style="color:white;"><strong>Not a member yet? Why not Sign up today </strong></span>

<br />

<a class="button login" href="{$mybb->settings['bburl']}/member.php?action=login" onclick="$('#quick_login').modal({ fadeDuration: 250, keepelement: true }); return false;"><font color="white"><i style="font-size: 16px;" class="fa fa-check-circle-o fa-fw"></i> Login to account</font></a> 

<a class="button2 register" href="{$mybb->settings['bburl']}/member.php?action=register"><font color="white"><i style="font-size: 16px;" class="fa fa-plus-circle fa-fw"></i>  Create an account &nbsp;</font></a>
-->


And keep on modifying this and improving it further to your hearts content, best of luck. Smile

[attachment=42479]
Thank you @vintagedaddyo that works fine.
if i want to make some changes, what should i do?
for example
if i want to add another text,

i have no idea about php that why i am asking.. Toungue
(2020-01-19, 11:53 AM)Mastersly Wrote: [ -> ]Thank you @vintagedaddyo that works fine.
if i want to make some changes, what should i do?
for example
if i want to add another text,

i have no idea about php that why i am asking.. Toungue

No worries, hope it helped. Smile  Anyhoo, simple enough so say you wanted to add another line unde thes two

inc/plugins/anonshare_welcomeguest.php
        <ul>
            <li>'.$lang->anonshare_welcomeguest_discuss.' <span style="color: #3f9889;">'.$stats['numusers'].'</span> '.$lang->anonshare_welcomeguest_othermembers.'<span style="color: #3f9889;">'.$stats['numthreads'].'</span>'.$lang->anonshare_welcomeguest_topics.'</li>
            <li>'.$lang->anonshare_welcomeguest_browse.'<span style="color: #3f9889;">'.$stats['numposts'].'</span>'.$lang->anonshare_welcomeguest_posts.'</li>
        </ul>

So lets add another line for example sake


inc/plugins/anonshare_welcomeguest.php
        <ul>
            <li>'.$lang->anonshare_welcomeguest_discuss.' <span style="color: #3f9889;">'.$stats['numusers'].'</span> '.$lang->anonshare_welcomeguest_othermembers.'<span style="color: #3f9889;">'.$stats['numthreads'].'</span>'.$lang->anonshare_welcomeguest_topics.'</li>
            <li>'.$lang->anonshare_welcomeguest_browse.'<span style="color: #3f9889;">'.$stats['numposts'].'</span>'.$lang->anonshare_welcomeguest_posts.'</li>
            <li>'.$lang->anonshare_welcomeguest_newlineoftext.'</li>
        </ul>


Ok notice we added the line but now we need to define the lang text for it since it os localized  so we add that in the language file like so

inc/languages/english/anonshare_welcomeguest.lang.php
$l['anonshare_welcomeguest_newlineoftext']='Here is some new line of text!';


Looks good so far that you are using it but you forgot one step


comment out the following in igame header_welcomeblock_guest


<!-- -->

header_welcomeblock_guest
<!--
<span style="color:white;"><strong>Not a member yet? Why not Sign up today </strong></span>

<br />

<a class="button login" href="{$mybb->settings['bburl']}/member.php?action=login" onclick="$('#quick_login').modal({ fadeDuration: 250, keepelement: true }); return false;"><font color="white"><i style="font-size: 16px;" class="fa fa-check-circle-o fa-fw"></i> Login to account</font></a> 

<a class="button2 register" href="{$mybb->settings['bburl']}/member.php?action=register"><font color="white"><i style="font-size: 16px;" class="fa fa-plus-circle fa-fw"></i>  Create an account &nbsp;</font></a>
-->

That will remove the duplicate buttons for guests up top since we are displaying the in the welcome guest plug but by removing the top ones for guest disply this does not remove the menu display for logged in users. Give it a try, it to me looks nicer at least since having the duplicates kinda is pointless up top now Wink
did it..
Looks better.
thank you for your help
i got a problem with that.
i just upload a second heme on my forum and i reinstall the plugin.
now it show me the welcome box two times in the first theme
(2020-01-26, 01:34 AM)Mastersly Wrote: [ -> ]i got a problem with that.
i just upload a second heme on my forum and i reinstall the plugin.
now it show me the welcome box two times in the first theme


Go into index template and portal template and delete the duplicate
{$anonshare_welcomeguest}

so there is only one

But if you remember we did this plugin using specific theme styling so in another theme it wont necessarily work right styling wise and would require me to add plugin specific styling and stylesheet so that we can change the styling per theme. Oh, also it has been awhile since I looked at emerald but there were some things like https://community.mybb.com/thread-222097...pid1324942 , https://community.mybb.com/thread-222306...pid1326001 etc, etc, while I think it got an update since back then, some of that may be still useful.

Another thing to note is you need to uninstall fontawesome icons 4 plugin, upgrade all font awesome icons in igame from 4.7 to 5 (more of a task as it isnt just swapping out the library, each inline call needs to be modified as well as the defined icons in css also need to be modified for the changes in the 5 library that are much different than 4) and then and only then install the fontawesomeicons plugin for fontawesome 5 https://community.mybb.com/mods.php?action=view&pid=909 following the modified theme instructions like you did for the 4.7 plugin since you were only using a theme with fa 4.7 and emerald is fa5 so the fa4 plugin will only work for themes with fa4 and you cannot run both the 4 and 5 plugin side by side, just saying. Also since the current welcome plugin was built for your specific theme and uses theme specific styling and fa 4.7 icons, you will notice that issue also and like I said the plugin would need to be further changed to remove theme specific existing styling and then modify with new styling to attach a plugin specific stylesheet on onstall to each theme thus allowing for theme specific styling as that can also be done but was not part of the original task and would have to be done at a time I may have free time to do so, as the initial parts of this were provided as a starting point for you based on existing elements and requirements presented to me at the time, not planned for me to keep building and expanding upon said provided free plugin, but yeah if I find the free time I will modify it as described.
Pages: 1 2