TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 629
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 515
  • Total: 515

Greetings: Birthday, Holiday, Time of Day

Started by JPDeni, October 22, 2006, 11:48:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

technodragon73

ahhhh....didn't realize you modified the friest message

ROFL

tamasir

JPDeni!
Your  the demo ? I'd love to get your demo. ;)
tamasir~

JPDeni

You can go to my site and see it in action. Since there's no holiday today, it won't show anything. I suppose you could sign up for an account and say that today was your birthday and you would get the birthday message.

Oh. That just occurred to me. I should have something different when people first sign up. Otherwise it will tell them "Happy Anniversary" on their first day.

Back to the drawing board. ....  :)

JPDeni

Okay. Minor edit.

In the greetings function, change


  if (date('d m',$row['dateRegistered']) == date('d m',time()))
  {
    if (isset($txt['anniversary']))
      $greeting_array[] = 'anniversary';
  }


to


  if (date('d m',$row['dateRegistered']) == date('d m',time()))
  {
    if (date('Y',$row['dateRegistered']) == date('Y',time()))
    {
      if (isset($txt['firstday']))
        $greeting_array[] = 'firstday';
    }
    elseif (isset($txt['anniversary']))
      $greeting_array[] = 'anniversary';
  }


and in the Greetings.english.php file, add

$txt['firstday']['all'] = 'Welcome ';
$txt['img']['firstday']['all'] = 'rose.gif';


Here's a rose to give your new members:

tamasir

JPDenis!
Thank your so very much! :up:
tamasir~

dy

Just wondering, once 'installed' into TP, I keep getting weird characters appearing in front of the picture and text, something like this:

ÃÆ'Ã,¯Ã‚Ã,»Ã‚Ã,¿ÃÆ'Ã,¯Ã‚Ã,»Ã‚Ã,¿ [[Picture Placeholder Here]] Good Afternoon
(Hopefully you can see it)

The picture (where the [[Picture Placeholder]] Is) and the text, appear correctly, but regardless of the 'event' whether it be a birthday or just good afternoon, these weird characters still appear.

I checked out all the code in the two files, and the code in my 'block', but I still don't know what's causing the problem. Any ideas??

JPDeni

Did you try taking out the greeting() command to see if it still happens with it?

There is nothing in the function that would print out those characters, or anything else, other than what you have defined in your $txt file. It must be something else.

dy

Quote from: JPDeni on November 16, 2006, 12:47:30 PM
Did you try taking out the greeting() command to see if it still happens with it?

There is nothing in the function that would print out those characters, or anything else, other than what you have defined in your $txt file. It must be something else.

I tried taking the greeting() command out, but the weird text is still there...


This is the code I'm using for the Portal Block:
require_once($sourcedir . 'UserFunctions.php');
echo '<span style="font-size: 8pt;"> ',greeting(),'<br /><b>'.$context['user']['name'],'</b></span><br />';



After taking the greeting() command out, the weird text still appears before the user's name.
It seems like it has something to do with combining the require_once() command and the echo() command.  If just reduce the code to this:
require_once($sourcedir . 'UserFunctions.php');
echo 'Hello';


Then it displays the weird text, then "Hello".


Just leaving this code in the Portal Block:
echo 'Hello';

It displays "Hello" fine.


I don't know whether it may be something to do with the UserFunctions.php file or some parsing error on TP. Please try your best to help me solve this problem.

JPDeni

Take out the $sourcedir thing. The command is

require_once('UserFunctions.php');

This is what works.

Also, I'm wondering what is before your require_command. Unless you have something else in the UserFunctions.php file, there's nothing in there that should be displaying anything but what was defined in your language file.

dy

Thanks for the quick response!!!  But it doesn't change anything at all when I take the $sourcedir out!

Before the require command? Nothing.  This code, is the only code that is sitting in the Portal Block:

require_once('UserFunctions.php');
echo '<span style="font-size: 8pt;"> ',greeting(),'<br /><b>'.$context['user']['name'],'</b></span><br />';


And I've taken exactly what was in the code for the UserFunctions.php, from your first post in this topic, no changes.  Deleting or adding lines in the Greetings.english.php file won't affect it would it? (Like deleting events you have put in which I don't have in my calendar - such as Thanksgiving)

Anyway, if you want a link to my forum, I'll PM it to you.

This website is proudly hosted on Crocweb Cloud Website Hosting.