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 login or register.

* Who's Online

  • Dot Guests: 600
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* 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]

Installation errors? Mod incompatibilities? Upgrade problems? Make your way over to the Install and Upgrade Support board for all your solutions!

Author Topic: Custom User Info Block...  (Read 6855 times)

0 Members and 1 Guest are viewing this topic.

Offline Elesarr

  • Semi Newbie
  • *
  • Posts: 17
  • Gender: Male
    • The Knights of Azeroth
  • SMF Version: 1.1.9
  • SP Version: 2.2.1
Custom User Info Block...
« on: June 06, 2009, 11:18:29 AM »
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

Code: [Select]
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.


Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Custom User Info Block...
« Reply #1 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.
And slowly, you come to realize... It's all as it should be...

Offline Elesarr

  • Semi Newbie
  • *
  • Posts: 17
  • Gender: Male
    • The Knights of Azeroth
  • SMF Version: 1.1.9
  • SP Version: 2.2.1
Re: Custom User Info Block...
« Reply #2 on: June 06, 2009, 11:36:23 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:

Code: [Select]
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);
« Last Edit: June 06, 2009, 11:50:15 AM by Elesarr »


Offline Elesarr

  • Semi Newbie
  • *
  • Posts: 17
  • Gender: Male
    • The Knights of Azeroth
  • SMF Version: 1.1.9
  • SP Version: 2.2.1
Re: Custom User Info Block...
« Reply #3 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.


Offline Manu

  • Translator
  • *
  • Posts: 203
  • Gender: Female
  • Angel by Day, Devil by Night
    • Arsenie Official Forum
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Custom User Info Block...
« Reply #4 on: June 06, 2009, 06:35:43 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!

Offline Elesarr

  • Semi Newbie
  • *
  • Posts: 17
  • Gender: Male
    • The Knights of Azeroth
  • SMF Version: 1.1.9
  • SP Version: 2.2.1
Re: Custom User Info Block...
« Reply #5 on: June 06, 2009, 07:29:01 PM »
open your SPortal1-1.php file

do a search for this code:

Code: [Select]

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.  :)


Offline Manu

  • Translator
  • *
  • Posts: 203
  • Gender: Female
  • Angel by Day, Devil by Night
    • Arsenie Official Forum
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Custom User Info Block...
« Reply #6 on: June 07, 2009, 08:13:59 AM »
open your SPortal1-1.php file

do a search for this code:

Code: [Select]

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!

Offline Elesarr

  • Semi Newbie
  • *
  • Posts: 17
  • Gender: Male
    • The Knights of Azeroth
  • SMF Version: 1.1.9
  • SP Version: 2.2.1
Re: Custom User Info Block...
« Reply #7 on: June 07, 2009, 08:32:51 AM »
open your SPortal1-1.php file

do a search for this code:

Code: [Select]

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  :)


Offline Manu

  • Translator
  • *
  • Posts: 203
  • Gender: Female
  • Angel by Day, Devil by Night
    • Arsenie Official Forum
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Custom User Info Block...
« Reply #8 on: June 07, 2009, 08:48:43 AM »
open your SPortal1-1.php file

do a search for this code:

Code: [Select]

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']
Code: [Select]
echo '
                           ',  txt['hello_member'], ' <strong>', !empty($member_info['colored_name']) ? $member_info['colored_name'] : $member_info['name'], '</strong>

                           <br /><br />';

in this code
Code: [Select]
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!

Offline Elesarr

  • Semi Newbie
  • *
  • Posts: 17
  • Gender: Male
    • The Knights of Azeroth
  • SMF Version: 1.1.9
  • SP Version: 2.2.1
Re: Custom User Info Block...
« Reply #9 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 of SP and ver 1.1.9 of SMF correct?
« Last Edit: June 07, 2009, 09:05:37 AM by Elesarr »


Offline Manu

  • Translator
  • *
  • Posts: 203
  • Gender: Female
  • Angel by Day, Devil by Night
    • Arsenie Official Forum
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Custom User Info Block...
« Reply #10 on: June 07, 2009, 09:06:39 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!

Offline Elesarr

  • Semi Newbie
  • *
  • Posts: 17
  • Gender: Male
    • The Knights of Azeroth
  • SMF Version: 1.1.9
  • SP Version: 2.2.1
Re: Custom User Info Block...
« Reply #11 on: June 07, 2009, 09:11:35 AM »
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  :)


Offline Elesarr

  • Semi Newbie
  • *
  • Posts: 17
  • Gender: Male
    • The Knights of Azeroth
  • SMF Version: 1.1.9
  • SP Version: 2.2.1
Re: Custom User Info Block...
« Reply #12 on: June 07, 2009, 03:06:59 PM »
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:
Code: [Select]
echo '
', $txt['hello_member'], ' <strong>', !empty($member_info['colored_name']) ? $member_info['colored_name'] : $member_info['name'], '</strong>
<br /><br />';

replace with:
Code: [Select]
// 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
« Last Edit: June 07, 2009, 03:40:43 PM by Elesarr »


Offline Manu

  • Translator
  • *
  • Posts: 203
  • Gender: Female
  • Angel by Day, Devil by Night
    • Arsenie Official Forum
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Custom User Info Block...
« Reply #13 on: June 07, 2009, 03:53:26 PM »
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!

Offline Elesarr

  • Semi Newbie
  • *
  • Posts: 17
  • Gender: Male
    • The Knights of Azeroth
  • SMF Version: 1.1.9
  • SP Version: 2.2.1
Re: Custom User Info Block...
« Reply #14 on: June 07, 2009, 04:20:41 PM »
I am glad it worked and that I could help you Manu!  8)