Skip to Content Skip to Menu

ProfileBook 1.0 - notify in cb_login

15 years 11 months ago #83250 by steveometer
Replied by steveometer on topic Re:ProfileBook 1.0 - notify in cb_login
oops

you need to use onAfterLogoutForm

because the logout form is shown to logged in users

if you log out, you'd see the plugin happen

SoM

Please Log in or Create an account to join the conversation.

  • user8600
  • user8600
  • OFFLINE
  • Posts: 24
  • Thanks: 0
  • Karma: 3
15 years 11 months ago #83255 by user8600
Replied by user8600 on topic Re:ProfileBook 1.0 - notify in cb_login
Yes, maybe that is it.
I see the logout form, when I'm logged in....

Please Log in or Create an account to join the conversation.

  • NuMoon
  • NuMoon
  • OFFLINE
  • Posts: 8
  • Thanks: 0
  • Karma: 11
15 years 10 months ago #83380 by NuMoon
Replied by NuMoon on topic Re:ProfileBook 1.0 - notify in cb_login
Ok, done it;

[code:1]
$_PLUGINS->registerFunction( 'onAfterLoginForm','showPBTab','getProfileBookTab' );
$_PLUGINS->registerFunction( 'onAfterLogoutForm','showPBTab','getProfileBookTab' );

class getProfileBookTab extends cbTabHandler {
/**
* Construnctor
*/
function getProfileBookTab () {
$this->cbTabHandler();
}

function showPBTab ($name_length, $pass_length, $horizontal, $class_sfx, &$params) {
global $my,$database;
$my_id = $my->id;
$database->setQuery("SELECT count(id) FROM #__comprofiler_plug_profilebook WHERE userid=$my_id AND status=0"«»);
$unreadPB = $database->loadResult();
if ($unreadPB > 0) {
return "<br /><table width=\"100%\" border=\"0\">"
."<tr><td colspan=\"4\" class=sectiontableheader><a href=".sefRelToAbs('index.php?option=com_comprofiler').">You have"." ".$unreadPB." "."new profile book Post(s)"."</a></td></tr>"
."</table>";}


}
[/code:1]

Have fun all ;)

NuMoon

I have attached the installer with the modifications (if you have made the database changes you can just use the files in it)

Attachment plug_cbprofilebook_Modded.zip not found



Post edited by: NuMoon, at: 2009/01/05 19:20
Attachments:

Please Log in or Create an account to join the conversation.

  • user8600
  • user8600
  • OFFLINE
  • Posts: 24
  • Thanks: 0
  • Karma: 3
15 years 10 months ago #83400 by user8600
Replied by user8600 on topic Re:ProfileBook 1.0 - notify in cb_login
Karma +1

It works great.

Old problem:
The installer doesn't create the field status if the table plug_cbprofilebook already exists (original plug_cbprofilebook)
But this can't be fixed only with sql. Can this be fixed with php (if necessary) on calling the cb.profilebook.php for the first time?

Post edited by: user8600, at: 2008/12/26 14:19

Please Log in or Create an account to join the conversation.

15 years 10 months ago #85818 by indiobestia
Replied by indiobestia on topic Re:ProfileBook 1.0 - notify in cb_login
Thank you Junior Joomlapolitan, it works like a charm!!

U R A GENIUS!!!

Please Log in or Create an account to join the conversation.

15 years 6 months ago #98475 by RebelFlicks
Replied by RebelFlicks on topic Re:ProfileBook 1.0 - notify in cb_login
"File name: plug_cbprofilebook_Modded.zip" didn't work for me.

I dropped plug_cbprofilebook from the database and deleted the original folder.

I get this message when trying to install:

"Direct Access to this location is not allowed."

This locks me out of the User Profile.

Post edited by: RebelFlicks, at: 2009/05/13 00:01

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum