Adult Script Pro Community Forums

The forum is here for legacy reasons. No new posts will be created. User registration is disabled! If you have any questions, please email us or check https://www.adultscriptpro.com for more details!

You are not logged in.

#1 2015-01-12 16:41:18

dereklro
Member
Registered: 2014-08-08
Posts: 37

How to add user avatar under video player?

I want to add the user's avatar under the video player in the video container where it lists "From: username" with the avatar linking to the user's profile. I've been playing around with the code for a while, but have not succeeded. Does anyone know how to do this?


logo.png

Offline

#2 2015-01-12 19:09:49

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: How to add user avatar under video player?

Edit modules/video/components/video.php and edit:

vm.meta_desc, vm.meta_keys, u.username, v.mobile,

and replace with:

vm.meta_desc, vm.meta_keys, u.username, v.mobile, u.gender, u.avatar,

Then edit templates/your-template/video_view.tpl.php and replace:

<span><?php echo __('from'),':</span> <a href="',RELATIVE_URL; ?>/users/<?php echo e($this->video['username']),'/">',e($this->video['username']); ?></a>

with:

<span><?php echo __('from'),':</span> <a href="',RELATIVE_URL; ?>/users/<?php echo e($this->video['username']),'/"><img src="',USER_URL,'/'; if ($video['avatar'] != ''): echo $video['user_id'],'.',$video['avatar']; else: echo 'nopic-',$video['gender'],'.gif'; endif; echo " alt="">',e($this->video['username']); ?></a>

Should work, but if you receive a error, please post it here and i will fix.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#3 2015-01-12 20:04:18

dereklro
Member
Registered: 2014-08-08
Posts: 37

Re: How to add user avatar under video player?

I tried the code you provided and had a problem with it. You mentioned "Edit modules/video/components/video.php" and only found a closely named file called view.php, but no video.php. I edited the view.php since it had the code you mentioned for the first code and replaced it with your code. Then I edited my video_view.php and replaced the code with yours, but after reloading the page I get the header and nothing below that will show up. Is the img tag closed? I looked at it for a bit, but was not able to figure out the cause.

Thank you for the help! I know a great deal of html/css, but am still learning php.


logo.png

Offline

#4 2015-01-14 17:33:51

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: How to add user avatar under video player?

Enable debug in admin and reload the page. A error should appear.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

Board footer

Powered by FluxBB