• Page 2 of 2
  • «
  • 1
  • 2
Forum moderator: bigblog  
uCoz Community » For Webmasters » Custom Solutions » How to put avatar on page with user entries of file catalog
How to put avatar on page with user entries of file catalog
Harina
Posts: 62
Reputation: 0

Message # 16 | 6:21 AM
bigblog, yeah that code now works even with slash at end. Thank you so much sir! If you get some time can you help me with file catalog as well? i mean page with user entries like the video
juliebenz98
Posts: 2
Reputation: 0

Message # 17 | 6:42 AM
bigblog, thats quite impressive!

Code
<?if($PAGE_ID$ == 'usr_entry_page')?>
<!--====LOAD THE PROFILE BANNER FROM THE PROFILE PAGE======-->
<div id="loadcontent"></div>
<script type="text/javascript">
var pathComponents = window.location.pathname.split('/');
var lastIdx = pathComponents.length - 1;
var viusrId = pathComponents[lastIdx] || pathComponents[lastIdx - 1];
// Array.prototype.pop should be supported in pretty much every browser
// unless you're using some ancient artifact of a browser

$('#loadcontent').load('/index/8-' + viusrId + ' #export');
// Template literals/string interpolation is not supported in most old browsers
</script>
<!--====LOAD THE PROFILE BANNER FROM THE PROFILE PAGE======-->
<?endif?>


how can this code be modified to work on the file catalog as well?
joexyz
JOE-vascript
Posts: 1770
Reputation: 78

Message # 18 | 6:38 PM
Code
<div id="loadcontent"></div>
<script type="text/javascript">
var userId = window.location.pathname.split('/')[2].split('-')[2];
$('#loadcontent').load('/index/8-' + userId + ' #export');
</script>


If I recall correctly there's a separate template for the user's entries, so you might not need the condition. Either way, $PAGE_ID$ is udata.

hey i'm joe and i do not work for the company anymore, please contact other staff or tech support
icon by ch-chau

sometimes i lurk here
Harina
Posts: 62
Reputation: 0

Message # 19 | 9:22 PM
bigblog, did you test this code? its not working sad sad
joexyz
JOE-vascript
Posts: 1770
Reputation: 78

Message # 20 | 4:00 PM
Harina, there was a typo, it should work now.
hey i'm joe and i do not work for the company anymore, please contact other staff or tech support
icon by ch-chau

sometimes i lurk here
uCoz Community » For Webmasters » Custom Solutions » How to put avatar on page with user entries of file catalog
  • Page 2 of 2
  • «
  • 1
  • 2
Search: