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
(2020-01-18, 06:14 PM)WallBB Wrote: [ -> ]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

I will still suggest this method because it avoids the usage of plugin for such simple tasks.
And back to the subject matter actually being asked about shall we now this far already into the discussion in regards to an already existing creation provided, discussed and created via this thread that said user now needed sone further changes with... Wink

Ok, I don't currently have the free time to finetooth this at the moment and only had a short amount of time as my cell battery was getting low, but this is a basic idea of how adding a stylesheet to it per theme would go for starters:

* I won't repost the lang files at the moment here because no real changes except ver # are made to them
<?php
/*
 * MyBB: AnonShare Welcome Guest
 *
 * File: anonshare_welcomeguest.php
 * 
 * Author: Vintagedaddyo
 *
 * MyBB Version: 1.8
 *
 * Plugin Version: 1.1
 *
 * 
 */

// 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}');
    
    // activate stylesheet
    
    global $db;
    
    $stylesheet = '@media only screen and (max-width: 400px) { 
.anonshare_welcome_msg {
 margin-bottom:48px;
}
}

.trow1.anonshare_welcome_body {
	background: #161616 url("images/anonshare_welcome/trow1-body1.png") no-repeat 50% 50%;
	background-size: cover;
	min-height: 220px;
	position: relative;
}

.anonshare_welcome_msg {
	padding: 5px;
	font-size: 14px;
	font-weight: bold;
	color: #ffffff;
}

.anonshare_welcome_stats {
	color: #3f9889;
}

.anonshare_welcome_buttons {
 position: absolute;
 padding: 5px;
 right: 0;
 bottom: 0;	
}

.anonshare_welcome_question {
	font-weight: bold;
	color: #ffffff;
}

a.anonshare_welcome_button_login {
	background: #3f9889;
	color: #fff;
	text-shadow: rgba(0,0,0,0.4) 0px 1px 1px;
	-moz-box-shadow: rgba(0,0,0,0.15) 0px 1px 3px;
	-webkit-box-shadow: rgba(0,0,0,0.15) 0px 1px 3px;
	box-shadow: rgba(0,0,0,0.15) 0px 1px 3px;
	-moz-background-clip: padding;
	-webkit-background-clip: padding-box;
	background-clip: padding-box;
	-moz-border-radius: 2px;
	-webkit-border-radius: 2px;
	border-radius: 2px;
	display: inline-block;
	padding: 6px 8px;
	margin: 2px 2px 6px 2px;
	transition: text-shadow 3s;
	-moz-transition: text-shadow 3s;
	-webkit-transition: text-shadow 3s;
	-o-transition: text-shadow 3s;
	font-family: "Roboto Condensed", sans-serif;
	font-size: 14px;
	font-style: normal;
}

a.anonshare_welcome_button_login:hover {
	background: #646464;
	color: #fff;
	text-shadow: #82241f 0px 1px 1px;
	-moz-box-shadow: rgba(0,0,0,0.15) 0px 1px 3px;
	-webkit-box-shadow: rgba(0,0,0,0.15) 0px 1px 3px;
	box-shadow: rgba(0,0,0,0.15) 0px 1px 3px;
	-moz-background-clip: padding;
	-webkit-background-clip: padding-box;
	background-clip: padding-box;
	-webkit-transition: background-color 600ms linear, color 600ms linear;
	-moz-transition: background-color 600ms linear, color 600ms linear;
	-o-transition: background-color 600ms linear, color 600ms linear;
	-ms-transition: background-color 600ms linear, color 600ms linear;
	transition: background-color 600ms linear, color 600ms linear;
}

a.anonshare_welcome_button_register {
	background: #3f9889;
	color: #fff;
	text-shadow: rgba(0,0,0,0.4) 0px 1px 1px;
	-moz-box-shadow: rgba(0,0,0,0.15) 0px 1px 3px;
	-webkit-box-shadow: rgba(0,0,0,0.15) 0px 1px 3px;
	box-shadow: rgba(0,0,0,0.15) 0px 1px 3px;
	-moz-background-clip: padding;
	-webkit-background-clip: padding-box;
	background-clip: padding-box;
	-moz-border-radius: 2px;
	-webkit-border-radius: 2px;
	border-radius: 2px;
	display: inline-block;
	padding: 6px 8px;
	margin: 2px 2px 6px 2px;
	transition: text-shadow 3s;
	-moz-transition: text-shadow 3s;
	-webkit-transition: text-shadow 3s;
	-o-transition: text-shadow 3s;
	font-family: "Roboto Condensed", sans-serif;
	font-size: 14px;
	font-style: normal;
}

a.anonshare_welcome_button_register:hover {
	background: #646464;
	color: #fff;
	text-shadow: #82241f 0px 1px 1px;
	-moz-box-shadow: rgba(0,0,0,0.15) 0px 1px 3px;
	-webkit-box-shadow: rgba(0,0,0,0.15) 0px 1px 3px;
	box-shadow: rgba(0,0,0,0.15) 0px 1px 3px;
	-moz-background-clip: padding;
	-webkit-background-clip: padding-box;
	background-clip: padding-box;
	-webkit-transition: background-color 600ms linear, color 600ms linear;
	-moz-transition: background-color 600ms linear, color 600ms linear;
	-o-transition: background-color 600ms linear, color 600ms linear;
	-ms-transition: background-color 600ms linear, color 600ms linear;
	transition: background-color 600ms linear, color 600ms linear;
}

.anonshare_welcome_button_icon {
	font-size: 16px;
	color: #ffffff;
}';
    
    $new_stylesheet = array(
        'name' => 'anonshare_welcomeguest.css',
        'tid' => 1,
        'attachedto' => '',
        'stylesheet' => $stylesheet,
        'lastmodified' => TIME_NOW
    );
    
    $sid = $db->insert_query('themestylesheets', $new_stylesheet);
    
    $db->update_query('themestylesheets', array(
        'cachefile' => "css.php?stylesheet={$sid}"
    ), "sid='{$sid}'", 1);
    
    $query = $db->simple_select('themes', 'tid');
    
    while ($theme = $db->fetch_array($query))
      {
        
        require_once MYBB_ADMIN_DIR . 'inc/functions_themes.php';
        
        update_theme_stylesheet_list($theme['tid']);
        
      }
    
  }

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);
    
    // de-activate stylesheet
    
    global $db;
    $db->delete_query('themestylesheets', "name='anonshare_welcomeguest.css'");
    
    $query = $db->simple_select('themes', 'tid');
    
    while ($theme = $db->fetch_array($query))
      {
        
        require_once MYBB_ADMIN_DIR . 'inc/functions_themes.php';
        update_theme_stylesheet_list($theme['tid']);
        
      }
    
  }

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 = '
		<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 anonshare_welcome_body">
		<div class="anonshare_welcome_msg float_left"><h1>' . $lang->anonshare_welcomeguest_shout . '</h1>
 ' . $lang->anonshare_welcomeguest_create . '
        <ul>
            <li>' . $lang->anonshare_welcomeguest_discuss . ' <span class="anonshare_welcome_stats">' . $stats['numusers'] . '</span> ' . $lang->anonshare_welcomeguest_othermembers . '<span class="anonshare_welcome_stats">' . $stats['numthreads'] . '</span>' . $lang->anonshare_welcomeguest_topics . '</li>
            <li>' . $lang->anonshare_welcomeguest_browse . '<span class="anonshare_welcome_stats">' . $stats['numposts'] . '</span>' . $lang->anonshare_welcomeguest_posts . '</li>
        </ul>
     </div>
    <br />
 <div class="float_right"> 
<span class="anonshare_welcome_buttons">    
 <span class="anonshare_welcome_question">' . $lang->anonshare_welcomeguest_question . '</span>
<br />
        <a class="anonshare_welcome_button_register" href="' . $mybb->settings['bburl'] . '/member.php?action=register"><i class="fa fa-plus-circle fa-fw anonshare_welcome_button_icon"></i> 
            ' . $lang->anonshare_welcomeguest_createacct . '
      </a>
        <a class="anonshare_welcome_button_login" href="' . $mybb->settings['bburl'] . '/member.php?action=login"onclick="$(\'#quick_login\').modal({ fadeDuration: 250, keepelement: true }); return false;"><i " class="fa fa-check-circle-o fa-fw anonshare_welcome_button_icon"></i> ' . $lang->anonshare_welcomeguest_loginacct . '</font>
      </a>
     </span>
    </div>
    <br />
   </td>
		</tr>
	</tbody>
</table>
<br />';
      }
  }

?>

Note: I will try to get the mobile phone charged up and finish this off and upload the pkg zip** when my free time allows...

** [attachment=42503] *
* 1.1 should work for now for you as it is though I will perhaps look at it further when I have free time

https://github.com/vintagedaddyo/MyBB_Pl...come_Guest
(2020-01-18, 06:14 PM)WallBB Wrote: [ -> ]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
I tried that but it show me the box on the header next to the logo image.i dont want it there.


@vintagedaddyo  i fix the font awesome icons. i use fa4 for both themes and it works fine for the moment

about his
https://community.mybb.com/thread-222306...pid1326001
i dont that issue for the moment.

The welcome message works better on both theme but
the login button on emerald dont works
and i cant see the background image on both themes.i can see only a piece of it.
can i change the images? i mean new image for emerald theme.


the only problem i have with emerald theme is this
[Image: 210.png]
users cant see default image there
only if they put their own image it works
(2020-01-26, 05:20 PM)Mastersly Wrote: [ -> ]
(2020-01-18, 06:14 PM)WallBB Wrote: [ -> ]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
I tried that but it show me the box on the header next to the logo image.i dont want it there.


@vintagedaddyo  i fix the font awesome icons. i use fa4 for both themes and it works fine for the moment

about his
https://community.mybb.com/thread-222306...pid1326001
i dont that issue for the moment.

The welcome message works better on both theme but
the login button on emerald dont works
and i cant see the background image on both themes.i can see only a piece of it.
can i change the images? i mean new image for emerald theme.


the only problem i have with emerald theme is this
[Image: 210.png]
users cant see default image there
only if they put their own image it works


Did you read here and the other posts in it? https://community.mybb.com/thread-222097...pid1326022 as I mention about missing images along with other things. Also the login icon is not showing on the welcome plugin on emerald because those are fa4 icons and emerald uses fa5 like I already pointed out, thats why I stated previously about upgrading igame to use fa5 and then switching the fontawesomeplugin to the 5 version so both themes can use the fa5 plugin. I could say modify the welcome plugin button icons to be called from css and that would allow icon change but that still doesnt change your other fa plugin issue. Also notice how on mobile the login menu is missing on  emerald.., I discuss that in the links I shared. As far as the background and such for welcome plugin you would edit it via the plugin css on each theme at
anonshare_welcomeguest.css

And yeah it would need to be tweaked for mobile scaling . Anyhoo, currently away for a bit and do not currently have the free time to fully modify emerald on all these unrelated issues for you at the moment but those links I provided should help from the last time I had to help someone with that theme. Anyhoo, lemme know how things work out for you.

* also note: if I get a chance and some free time to go charge my laptop, I have igame updated for 1.8.22 along with issues fixed related to localization for it (bunch of hardcoded engish text, lang selector missing, etc etc).., already on my laptop localhost, so perhaps I can then update that updated version to also use fontawesome 5 and then share it with you and then perhaps relook at emerald for you after that. Not sure when I will get around to charging the laptop, but will let you know, most likely not today though as it is a sunday and that is a day of rest.

Here is iGame 1822: [attachment=42504] * Not everything was able to be localized but a bunch of it now is, plus it is updated for 1.8.22 usage though I don't have the time at the moment to update it to use font awesome 5 rather than fa 4.7 but will try to get to that soon and a few other things I been meaning to touch on regarding this..., whenever I get to those then I will look at emerald again

[Image: Screenshot-20200126-194215-Firefox.jpg]
what is this?
i already have igame skin and its fine..
my problem is with the mobile theme.
it dosnt show up the
Login register bar to the guest
and the text on some posts are outside the table llike this
https://anonshare.eu/Thread-The-Best-Web...769#pid769

the .post.classic .post_author
is messed up on mobile too

i read this
https://community.mybb.com/thread-222097...pid1326022
but nothing changed
(2020-01-27, 11:52 AM)Mastersly Wrote: [ -> ]what is this?
i already have igame skin and its fine..
my problem is with the mobile theme.
it dosnt show up the
Login register bar to the guest
and the text on some posts are outside the table llike this
https://anonshare.eu/Thread-The-Best-Web...769#pid769

the .post.classic .post_author
is messed up on mobile too

i read this
https://community.mybb.com/thread-222097...pid1326022
but nothing changed


As far as your avatar issue have tried something like this?

[Image: mini-avatar.png]

in header_welcomeblock_member find:
<li><a href="member.php?action=profile&uid={$mybb->user['uid']}">{$mybb->user['username']} <img src="{$mybb->user['avatar']}" style="float:right;width:25px;height:25px;border-radius:100%;margin-left:5px;"></a>


replace with:
<style>.mini-avatar { float:right; width:25px; height:25px; border-radius:100%; margin-left:5px; background: url('images/default_avatar.png') no-repeat; background-size: 100% auto; }
.mini-avatar img { width:25px; height:25px; border-radius:100%; }
.mini-avatar img[src=""] { display: none; }</style>
<li><a href="member.php?action=profile&uid={$mybb->user['uid']}">{$mybb->user['username']} 
    <div class="mini-avatar"><img src="{$mybb->user['avatar']}" alt="avatar" /></div></a>

* we are pulling default avatar from the main images directory in this rather than the emerald theme directory because even though emerald has its own theme directory defined, the pkg does not provide the images needed in its theme directory and I mentioned that in one of the links I shared.., and if you know what to look for you will see missing images in various parts of the theme due to that unless you copy the images folder contents into the emerald folder, something else I plan to correct when I update both variants, lol



as for your mobile issue, it won't be a problem once I finish updating the two theme variants for 1.8.22 whenever I get the free time to finish like I keep trying to explain...

[Image: light.png]

[Image: dark.png]



* igame is for 1817 = outdated and need to be updated for 1822 ** complete

* igame1822 updated fontawesome from 4 to 5 theme wide templates and css ** in progress * when my free time allows

* emerald light or dark variants are for 1812/1814 = outdated and need to be updated for 1822 -** in progress * when my free time allows

* any finishing touch needed to be made to the welcome plugin for both themes ** to be done when I get the two themes completely updated when my free time allows

Meaning if you have patience you wont have to fix these things on outdated themes because I am updating and doing them for you as my free time allows..., patience is a virtue.

Umm, firstly it is not fine , it is for 1817 and there are several outdated templates that need updating and changes needed in css in css for example like when mybb changed from lock to close, etc, etc..., just because something "appears" all good does not mean it is up to date. The igame above is updated for 1822 usage. Secondly, I did say I am getting to your requests one at a time as my "free" time allows. Now, emerald both light and dark variants is for 1812/1814 and needs a ton of updating, something I am also getting to. As far as my old tutorial edits, for that old theme, they do work if done correctly, but I am not focused on that at the bloody moment as I am trying to find the "free time" to now also update that theme(s) to 1822, then update igame1822 to fontawesome 5 usage so that you can use yet another of my free plugins the myfontawesomicons 5 on both themes rather than say oh I just switched a fa5 theme to use 4 simple as that when it is not as simply as  that and the entire css and inline calling is different and only works if the theme developer did not actually fully upgrade to 5 and still uses 4 calls in 5 library out of laziness like in the highly outdated emerald, lol. Anyhoo, after updating all of those 3 items, I also need to keep modifying a free plugin I built for you free of charge also, not as wam bam and simple thank you mam as one would think and is not the only tasks I have on my plate at the moment fyi, all while trying to do so from my mobile phone and limited battery life of such, while also having other requests to also try and focus on as well as my own projects and being human I also have a life and the distractions and such from that and get all the same emotions like any other human like when getting bombarded with requests, efforts underappreciated, overwhelmed by the lack of respect when I have stated clearly what I am getting to at such points with my limited time while doing this for free on a cell phone and yet getting straight up annoyed *hint hint, so patience is a virtue, I am practicing it greatly at the moment, just saying, when I clearly have not had to, nor had to continuously go the extra mile for something that started as a simple task and now has turned into request after freaking request, but seeing as you are the expert, perhaps I am wasting my time and efforts and should just let you figure it all out while using highly outdated themes you think are "just fine"



Also another thing I mentioned but will note again because it might save me time and not require me to update igame 1822 to use font awesome 5 or require switching to the myfontawesomicons 5 plugin, it is as follows while the theme author claims to have updated emerald to font awesome 5 and in a few places defines the icons properly for fa5 in css the inline calls are still for fa 4 and fa5 has this as a fallback feature for ease of devs during updating the font library transition

example of fa 4 inline
<i class="fa fa-comments">

example of fa5 inline

<i class="fas fa-comments">

* but also uses far, fab, fas etc, etc and is called and defined and called differently via css than fa4..., (that is why the fa5 myfontawesomeicons plugin is so different than the fa4 plugin)

so since the theme author didn't actually update the inline icons for fa5, I could while updating the theme rollback the css and headerinclude library call to fa4 and use the existing inline fa4 icon calls..., so that when I provide you the updated emerald light and dark themes, you can then install igame 1822, emerald 1822 light and dark and then use the existing myfontawesomeicons 4 plugin you are already using as that would save me time since I already updated igame to 1822 but haven't got around to updating the entire theme to fa5 usage and while emerald claims fa5 it really is on fallback so instead of focusing time on updating igame 1822 to full fa5 I can fous on updating the emerald themes to 1822 and save time rolling that updated variant to fa4 usage, if that makes sense, then I can after that focus on the welcome plug styling specific for all three 1822 updated themes, lol Wink
Looks like they're brewing the high-test stuff at https://ko-fi.com/vintagedaddyo
I'll wait a little while before buying you a cuppa joe. Wink

I do like your work, and the explanation you put into it.
ok, sorry about the time lapse, but, I haven't had much free time to get to all of the 3 themes updates discussed here as of yet but here is the previous igame theme that I had updated and shared previously in this thread for 1.8.22, now also updated to use font awesome 5 rather than font awesome 4...., as I was able to finally set only a short amount of time aside to quickly do that and a few other quick modifications as my limited time allowed...,

igame1.8.22: http://s000.tinyupload.com/index.php?fil...2981120144 * now using fa 5 library

https://github.com/vintagedaddyo/MyBB-Theme-iGame * any further edits, changes or modifications if made in the future on the 1.8.22 variant will be found at the github repo for it.


As for the other two emerald variant themes, I have both partially already updated but have yet to be able to find the free time to dedicate to finishing them up..., as not only do they need updating but there are a few other issues to fix some of which I already have completed but just have not had further free time as of late to focus on them, though if and or when I do, I will also share them here as previously discussed as I have not forgotten about them.
Well, since it appears you opted to change themes yet again and no longer use either of the last three themes I have been updating for this thread when I get free time to do so nor the custom plugin provided here I will cease progress on further updates or modifications.





Something to note on your latest theme choice though whether you optained the theme legally or aquired it as a an illegally ripped theme *



* Note: While completely unrelated to the past thread content but related to viewing your source



I notice that the theme is missing theme copyright and the most important the mybb copyright so I would hope you got permission from the theme designer to remove theme copyright. Theme Designer: ( https://skryptec.net/ whom designed that theme for: https://cracked.to/ not for a bunch of script kiddies on sites like nulledbb and what not to to rip the theme, distribute said "pirated theme" and leech while also using such with both the author and mybb copyrights removed, just saying, food for thought ) I would suggest even if you got permission to remove the theme author copyright of which we both know is not true, at least putting the mybb copyright back in your theme so as to avoid being flagged here as denied community support, and perhaps consider putting the theme author copyright back in if and or when you actually get permission from theme author to use the theme legally by purchase or other permitted options that the author may agree upon and not use a ripped version. The source has been provided if you wish to contact the author for permission, purchase, etc, etc. Best of luck! Cool


				<!-- MyBB is free software developed and maintained by a volunteer community.
					It would be much appreciated by the MyBB Group if you left the full copyright and "powered by" notice intact,
					to show your support for MyBB.  If you choose to remove or modify the copyright below,
					you may be refused support on the MyBB Community Forums.

					This is free software, support us and we'll support you. -->
				{$lang->powered_by} <a href="https://mybb.com" target="_blank" rel="noopener">MyBB{$mybbversion}</a>, &copy; 2002-{$copy_year} <a href="https://mybb.com" target="_blank" rel="noopener">MyBB Group</a>.
				<!-- End powered by -->

etc, etc....

&copy; <a href="https://cracked.to" title="Cracked.to">Cracked.to&nbsp;</a> 2018 - {$copy_year}| All Rights Reserved.

Made with &nbsp;<a href="https://skryptec.net/" title="https://skryptec.net/"><i class="fa fa-heart red"></i></a>&nbsp; for the community.
Pages: 1 2