Main Menu
collapse

Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

User Info

Welcome Guest.
Please log in.

Who's Online

  • Dot Guests: 930
  • Dot Hidden: 0
  • Dot Users: 1
  • Dot Users Online:

Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]


NEED HELP? If you're looking for support with Simple Portal, look no further than the Support Board!

Custom User Info Block...

Started by Elesarr, June 06, 2009, 11:18:29 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Elesarr

Hi all,

I upgraded to 2.2.2 this morning without a hitch, however, there was a change that I did not expect to occur even after reading the changes before applying the upgrade:

In version 2.2.1 I made a custom user info block because I use a custom greeting script to greet my forum members when they log on based on the the time of day it is for them locally.

After the upgrade the

sp_userInfo(array(), $id)

now displays the default "Hey, username" text - it did not do this before I applied the upgrade...how can I get it to go away now  :|

I've attached a screenshot of what I am talking about to clear any confusion in my post.

Thanks in advance.



[SiNaN]

Did you remove that part manually? Any custom changes you've made in SPortal1-1.php file will be removed with upgrade. I can help with getting rid of that "Hello" text if you attach your SPortal1-1.php file here.
And slowly, you come to realize... It's all as it should be...

Elesarr

#2
Quote from: [SiNaN] on June 06, 2009, 11:22:59 AM
Did you remove that part manually? Any custom changes you've made in SPortal1-1.php file will be removed with upgrade. I can help with getting rid of that "Hello" text if you attach your SPortal1-1.php file here.

Thanks for the reply SiNaN,

no I did not change anything in my original installation of 2.2.1, when I used the built in UserInfor Block the hello text showed up as I expected it to, but never showed up when I made the custom one.

I have attached the requested file.

Thank you for the assist!!

Edit

I just had an after thought here is the code I am using in my custom block in case it has an effect on how it is displaying now:

global $context, $settings, $options, $scripturl, $txt, $modSettings, $boardurl;
if ($context['user']['is_logged'])
{
// Start CGDT Mod by Nascar
echo '<center><span style="font-size: x-small;">';
$date = date('H', forum_time());
if($context['user']['is_logged'])
if ($date < 6)
   echo $txt['up_late_arent_we'];
elseif ($date < 7)
   echo $txt['are_you_the_early_bird'];
elseif ($date < 12)
   echo $txt['good_morning'];
elseif ($date < 18)
   echo $txt['good_afternoon'];
elseif ($date < 22)
   echo $txt['good_evening'];
elseif ($date < 24)
   echo $txt['shouldnt_you_be_going_to_bed_soon'];
echo ', <b>', $context['user']['name'] , '</b><br  /><br /></span></center>';
}
sp_userInfo(array(), $id);



Elesarr

I had some time so I thought I'd give it a shot myself and I found where to edit the file.

Thank you for pointing me to the correct file to edit SiNaN.

I know just enough php to be able to modify code and be dangerous - I was a former asp and asp.net coder  ;)

However, with you pointing me to the correct file to edit I made the change and it functions properly now  :D

Many thanks again! Consider this topic solved.



Manu

Quote from: Elesarr on June 06, 2009, 03:23:25 PM
I had some time so I thought I'd give it a shot myself and I found where to edit the file.

Thank you for pointing me to the correct file to edit SiNaN.

I know just enough php to be able to modify code and be dangerous - I was a former asp and asp.net coder  ;)

However, with you pointing me to the correct file to edit I made the change and it functions properly now  :D

Many thanks again! Consider this topic solved.

Can you tell me please what exactly you did?
I have this mod in my forum installed too and I want to use it in the user-info block too. :)
Sometimes I'm an angel, sometimes I'm a devil, but I am always 100% woman and if you have a problem with me, learn to deal with it!

Elesarr

open your SPortal1-1.php file

do a search for this code:


echo '
',  txt['hello_member'], ' <strong>', !empty($member_info['colored_name']) ? $member_info['colored_name'] : $member_info['name'], '</strong>

<br /><br />';


and either delete it or comment it out.  :)



Manu

Quote from: Elesarr on June 06, 2009, 07:29:01 PM
open your SPortal1-1.php file

do a search for this code:



echo '
                           ',  txt['hello_member'], ' <strong>', !empty($member_info['colored_name']) ? $member_info['colored_name'] : $member_info['name'], '</strong>

                           <br /><br />';


and either delete it or comment it out.  :)
Thanks for your help, a last question I have.  :-[
What I have to do when I will show up the user-name colored as it is now?
Sometimes I'm an angel, sometimes I'm a devil, but I am always 100% woman and if you have a problem with me, learn to deal with it!

Elesarr

Quote from: Manu on June 07, 2009, 08:13:59 AM
Quote from: Elesarr on June 06, 2009, 07:29:01 PM
open your SPortal1-1.php file

do a search for this code:



echo '
                           ',  txt['hello_member'], ' <strong>', !empty($member_info['colored_name']) ? $member_info['colored_name'] : $member_info['name'], '</strong>

                           <br /><br />';


and either delete it or comment it out.  :)
Thanks for your help, a last question I have.  :-[
What I have to do when I will show up the user-name colored as it is now?

shouldn't have to do anything at all.  if your member links are colored they will also be colored in the blocks.  unless you turn it off in the SP Admin panel.

and no worries I help when I can  :)



Manu

Quote from: Elesarr on June 07, 2009, 08:32:51 AM
Quote from: Manu on June 07, 2009, 08:13:59 AM
Quote from: Elesarr on June 06, 2009, 07:29:01 PM
open your SPortal1-1.php file

do a search for this code:



echo '
                           ',  txt['hello_member'], ' <strong>', !empty($member_info['colored_name']) ? $member_info['colored_name'] : $member_info['name'], '</strong>

                           <br /><br />';


and either delete it or comment it out.  :)
Thanks for your help, a last question I have.  :-[
What I have to do when I will show up the user-name colored as it is now?

shouldn't have to do anything at all.  if your member links are colored they will also be colored in the blocks.  unless you turn it off in the SP Admin panel.

and no worries I help when I can  :)
That's the problem, it doesn't show up the user name colored. I think it has to do with the differents of both codes.
With this code the user name is colored, cause of $member_info['colored_name']

echo '
                           ',  txt['hello_member'], ' <strong>', !empty($member_info['colored_name']) ? $member_info['colored_name'] : $member_info['name'], '</strong>

                           <br /><br />';


in this code
echo ', <b>', $context['user']['name'] , '</b><br  /><br /></span></center>';
I can't find it, the user name is only shown up as bold, but not colored.  :-[

I tried to mix both codes but I'm a dumb with php-coding and I don't get it to work.  :(
Sometimes I'm an angel, sometimes I'm a devil, but I am always 100% woman and if you have a problem with me, learn to deal with it!

Elesarr

#9
hmmm...I'm not sure why that code is not in your file  :|

I haven't edited my file except to remove that line of code I pointed out to you.

You are using ver 2.2.2 of SP and ver 1.1.9 of SMF correct?



Manu

Quote from: Elesarr on June 07, 2009, 09:00:01 AM
hmmm...I'm not sure why that code is not in your file  :|

I haven't edited my file except to remove that line of code I pointed out to you.

You are using ver 2.2.2 correct?
Yes I'm using 2.2.2, the problem is, delete I the code you asked me to delete in SPortal1-1.php, the code for coloring the user names is gone, cause in the code of CGDT Mod by Nascar the user name isn't colored.
Doesn't know how to explain it in English. :(
Sometimes I'm an angel, sometimes I'm a devil, but I am always 100% woman and if you have a problem with me, learn to deal with it!

Elesarr

right..I understand what you mean now:

you want the CGDT mod to have colored names like the normal code does correct?

Give me some time to play with the code a bit and I'll see what I can do to help you out ok  :)



Elesarr

#12
Hallo! Manu, sorry it took me so long to get back to you  :nervous-happy:

I will show you how to add the CGDT mod so it will work in the User Info box and color the member names.


in your SPortal1-1.php file find:
echo '
', $txt['hello_member'], ' <strong>', !empty($member_info['colored_name']) ? $member_info['colored_name'] : $member_info['name'], '</strong>
<br /><br />';


replace with:
// Start CGDT Mod by Nascar
$date = date('H', forum_time());
if($context['user']['is_logged'])
if ($date < 6)
   echo $txt['up_late_arent_we'],',';
elseif ($date < 7)
   echo $txt['are_you_the_early_bird'],',';
elseif ($date < 12)
   echo $txt['good_morning'],',';
elseif ($date < 18)
   echo $txt['good_afternoon'],',';
elseif ($date < 22)
   echo $txt['good_evening'],',';
elseif ($date < 24)
   echo $txt['shouldnt_you_be_going_to_bed_soon'],',';
// End CGDT Mod by Nascar
echo '
<strong>', !empty($member_info['colored_name']) ? $member_info['colored_name'] : $member_info['name'], '</strong>
</div><br /><br />';


and you will have a custom greeting with colored member names 8)

You can use the pre-made user info box since the changes were made to the SPortal1-1.php, no need to create a custom php block  ;)

Nicht vergessen!
If you have to do any updates to SP 2.2.2 that affect your SPortal1-1.php you will have to reapply this change I showed you.  So keep a copy of the changes in a safe place so you can use them again if needed.  :)

Let me know if any of my instructions were confusing!


To the Moderators:
This can probably be moved since its not really a support topic any more  ;P



Manu

It works like a charm and without any error messages in the log! :D

Take a look at it if you want. :D

Thanks a lot for your help!

Ich werde es nicht vergessen!
I will save the code at a save place at my computer! :D
Sometimes I'm an angel, sometimes I'm a devil, but I am always 100% woman and if you have a problem with me, learn to deal with it!

Elesarr

I am glad it worked and that I could help you Manu!  8)