简体   繁体   中英

Change logo for each user in Joomla

I am stuck somewhere as i could not find any solutions like i have a query can we change the logo for each user in joomla back-end ?

Or Any other CMS, can you suggest which contains this type of facility.I Need to show the different 2 logo for each other who has been registered on my website (administrator would do that)

Any Suggestion would be very thankful.

Thanks a lot !!

If you want a specific logo for each user, ie unique to each user, you can use a combination of CSS/PHP and save the images to a certain folder.

<style type="text/css">
<?php
$user =& JFactory::getUser();
?>
/* This needs to reference the element you are changing */
#logo{
      background: url(/blah/images/<?php echo $user->id; ?>-logo.png);
}
</style> 

Or you can simply swap the reference to the img if it is using an image rather than a background image.

<img src="/blah/<?php echo $user->id; ?>-logo.png"/>

I wasn't sure what version of Joomla, or which logo you were replacing so I could not be more specific. You could even take it one step further and check that the image/file exists first using

if(file_exists('path-to-blah/<?php echo $user->id; ?>-logo.png'))
...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM