1
TerryBogard
Another kind of Inbox-Block
  • 2004/3/16 12:38

  • TerryBogard

  • Just popping in

  • Posts: 8

  • Since: 2002/3/19


Hi everyone...
I found some interesting posts on inbox-blocks here, but what I´m tryin to do is a Block containing a flash-movie which checks if there are new messages by interval. So I need a PHP-File which I can load from this FlashMovie and gives me vars for newMessage=true/false...
This way the User doesn´t have to reload the page to check PMs. If it´s done I´d like to post it here so y´all can use it.

Can anybody help me out on this matter ?
Thanx Guys!

2
TerryBogard
Re: Another kind of Inbox-Block
  • 2004/3/16 13:45

  • TerryBogard

  • Just popping in

  • Posts: 8

  • Since: 2002/3/19


Hey I´m desperate !
Just need a PHP-File which returns some like: logged in/not logged in and newmessage=true/false...
Please give it a try folks !
Thanx.

3
carnuke
Re: Another kind of Inbox-Block
  • 2004/3/16 14:15

  • carnuke

  • Home away from home

  • Posts: 1955

  • Since: 2003/11/5


I'll post a link here shortly, Terry ..

edit: ok, go to http://varlinux.org and register. you will see a welcome XX message in the top header bar of the site once you have logged in. Click on your user name and send yourself a message through PM. Now refresh and you will see a message link appear next to the welcome name. IF this is what you want, follow THIS LINK To see how it's done. This is not my script, so I feel it's only right that you get it from source rather than me post it. PM me if you have any questions.

Edit-2: I've followed my inst. and seen that the site has now added a rotating message included in the (new private message) link. The original script posted by npetrely in the forum does NOT include that extra stuff, just a simple (new private message) link next to the logged in name

Richard

4
TerryBogard
Re: Another kind of Inbox-Block
  • 2004/3/16 14:41

  • TerryBogard

  • Just popping in

  • Posts: 8

  • Since: 2002/3/19


Hi Richard,
thanx for your reply!
I´ve already made something like that by editing 'system_block_user.html'-template so if there´s a new message a nice little FlashMovie appears and notifies the user to go to his inbox. What I had in mind was a FlashMovie which is diplayed permanently and loads vars from a single PHP-file which tells it if there are new messages or not - so the user doesn´t really have to reload the page to see. In the template it´s like this:
<{if $block.new_messages 0}>
        <
class="highlight" href="<{$xoops_url}>/viewpmsg.php"><{$block.lang_inbox}> (<span style="color:#ff0000; font-weight: bold;"><{$block.new_messages}>span>)a>
      <{else}>
        <
a href="<{$xoops_url}>/viewpmsg.php"><{$block.lang_inbox}>a>
      <{/if}>

Now if I get this to work by calling an external script in my xoops_root e.g. check_messages.php I could call this repeatedly to change the content of my FlashMovie on the Fly without any reload. Do you know how to do that? What must this script contain?

Another idea was to add some kind of switch to an existing script to pass on my needed vars e.g. if I called mainfile.php?returnFlashVars=true then it should echo loggedIn=true/false and newMessages=true/false so I can load this from my FlashMovie.... ?!?

5
TerryBogard
Re: Another kind of Inbox-Block
  • 2004/3/17 9:22

  • TerryBogard

  • Just popping in

  • Posts: 8

  • Since: 2002/3/19


Ok, so nobody can help me ?!?
Well, here´s a little something I came up with, but it won´t return anything when I call it - at least ANY ideas ANYBODY ?????

include "mainfile.php";
GLOBAL 
$xoopsUser;
$pm_handler =& xoops_gethandler('privmessage');
$uid $xoopsUser->getVar('uid');
$criteria = new CriteriaCompo(new Criteria('read_msg'0));
$criteria->add(new Criteria('to_userid'$uid));
$msgcount $pm_handler->getCount($criteria);
$GLOBALS['xoopsTpl']->assign('msgcount'$msgcount);

if(
$xoopsUser){
echo 
"&flashvar_loggedIn=yes&";
if(
$msgcount 0){
echo 
"&flashvar_newMessage=yes&";
}else{
echo 
"&flashvar_newMessage=no&";
}
}
else { 
echo 
"&flashvar_loggedIn=no&";
}
?>


Please make this return something guys, I count on y´all !

Login

Who's Online

417 user(s) are online (44 user(s) are browsing Support Forums)


Members: 0


Guests: 417


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits