I don't use profile_manager, I'm using the old usertype plugin. But the code I use to get exactly what you're asking for is this:
if ( $_SESSION['user']->usertype == "User1") {
add_menu(elgg_echo('pages'), $CONFIG->wwwroot . "pg/pages/owned/" . $_SESSION['user']->username,'pages');
This go in relevant plugin start.php
good luck!
Thanks,,,
the code I have tried is:
$p = page_owner_entity();
$pt = $p->custom_profile_type;
if (isloggedin() && $pt == 3) {
add_menu(elgg_echo('mood'), $CONFIG->wwwroot . "mod/mood/everyone.php");
}
Not sure if the ($_SESSION['user']->custom_profile_type == 3) statement would work but I'll read up on it.
Thanks for the idea
That worked Great!
Thanks Man
The jquery documentation is the best place to start to learn how to use $.post/ajax
Done spent a few hours going over that,,,,, some times I think I try to make stuff harder than it realy is.
I grew up on latterlogic from way back in 1982 or so I know a little about foxpro, C++ pertty good at html know some basic and bits and pieces of other languages...... then I found elgg lol PHP kicked my butt for a while and now I gotta figure out jquery I know I'll get it just wondering when lol.
It would be nice to see some real life examples of other peoples code,,,, don't know somehow that makes it easier
Examples are always easier. The jQuery docs usually have plenty of code examples. Here's one example specific to elgg, though:
<script>
$.post('//my.elgg.site/action/do/something', {
__elgg_ts: <?php echo $ts; ?>,
__elgg_token: "<?php echo $token; ?>"
}, function() { alert('yay'); });
</script>
this will call the action "do/something" with no arguments except the security tokens. Basically it is just like submitting a form to do/something but it does it in the background. Then, once the call returns (if it is a success) you will see 'yay' get alerted on your screen.
Thanks Cash its a good example to get me started,,, lol although I'm sure I'll have more questions in a few days.
I'm working on a marquee plugin which will allow business profile users (ie. Biker Bars or Motorcycle shops to scroll Drink specials, upcoming Bands, or monthly specials on thier profiles) and I had it working,,,, working great lol only it would only work for IE,,,, I'm sure you know the reason so now I'm having to rewrite some stuff using java , And if I was losted when I started this project using php, I am really losted incorperating java ,,, but I'm getting there little by little .
Thanks for all the help everyone.
I assume when you say java you mean javascript? I'm not sure why you would need to incorporate java into a php website just for a marquee?
yes it is javascript and I'm just feeling my way through a new type of programing for me, and suggestions would be a help lol
As a newbie I will like to have the following:
a) Detailed Elgg framework design which is explained through various diagrams. I believe diagrams are the best way to understand anything.
b) Good topics for Customizing elgg with end to end code.
c) Case studies / small projects with end to end working code
Basically I cannot find all these in one place. I will like to see this in your book.
Best wishes.....
Mainak
Will this book be available in an online format?
As Dave said, it will be available as an eBook (besides being available as a print book). It should also be in O'Reilly's Safari Books Online.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.