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 |
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? |
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 |
| |||