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 2016-03-16 20:43:27

phseven
Member
Registered: 2011-06-02
Posts: 78

Homepage mods

How to call models and channels to display under video thumb. my intention is to replace time and views by model names and channels.

Tried this code but doesn´t work


<span class="pull-left"><?php if (isset($this->pornstars) && $this->pornstars): echo '<br>',__('pornstars'),':'; foreach ($this->pornstars as $model):
echo '<a href="',REL_URL,'/pornstar/',$model['slug'],'/" >',e($model['name']),'</a>'; endforeach; endif; ?></span>

Offline

#2 2016-03-17 07:21:19

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

Re: Homepage mods

Hmm...you want to show the models for a video below the video?


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

Offline

#3 2016-03-17 08:32:13

phseven
Member
Registered: 2011-06-02
Posts: 78

Re: Homepage mods

Yes

Name of the model under the thumb in homepage and video view, same for channel name

Similar to changes in this image

Jazzie-Girls.jpg

Offline

#4 2016-03-17 14:44:06

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

Re: Homepage mods

Its not as easy as modifying the template. The data needs to be pulled out of the database in the components for the pages you want modified. For example in modules/video/components/video/browse.php you need to change:

        $sql            = "SELECT v.video_id, v.title, v.slug, v.likes, v.rating, v.rated_by, v.duration, v.thumb,
                                  v.thumbs, v.total_views, v.add_time, v.ext, v.hd, v.premium, v.type,
                                  u.username
                           FROM #__video AS v
                           LEFT JOIN #__user AS u ON (u.user_id = v.user_id)
                           WHERE v.status = 1";

to

        $sql            = "SELECT v.video_id, v.title, v.slug, v.likes, v.rating, v.rated_by, v.duration, v.thumb,
                                  v.thumbs, v.total_views, v.add_time, v.ext, v.hd, v.premium, v.type,
                                  u.username, v.channel_id, c.name AS cname, c.slug AS cslug,
                                  GROUP_CONCAT(m.name) AS models,
                                  GROUP_CONCAT(m.slug) AS slugs
                           FROM #__video AS v
                           LEFT JOIN #__user AS u ON (u.user_id = v.user_id)
                           LEFT JOIN #__channel AS c ON (c.channel_id = v.channel_id)
                           LEFT JOIN #__model_videos AS mv ON (mv.video_id = v.video_id)
                           LEFT JOIN #__model AS m ON (m.model_id = mv.model_id)
                           WHERE v.status = 1";

and you also need to add:

$sql .= "GROUP BY v.video_id";

right before:

switch ($order) {

Once this is done you can modify the code in the template (templates/defboot/_video_list.tpl.php), change:

                                <div class="video-details hidden-xs hidden-sm">
                                    <span class="pull-left"><?php echo VDate::nice($video['add_time']); ?></span>
                                    <span class="pull-right text-right"><?php echo $video['total_views'],' '; if ($video['total_views'] == '1'): echo __('view'); else: echo __('views'); endi
f; ?></span>
                                </div>

to:

                               <div class="video-details hidden-xs hidden-sm">
                                    <span class="pull-left">
                                    <?php $names = explode(',', $video['models']; $slugs = explode(',', $video['slugs']); $count = count($slugs); foreach ($slugs as $index => $slug): ?>
                                    <a href="<?php echo REL_URL,'/pornstar/',$slug,'/">',e($names[$index]); ?></a><?php if ($index !== $count): echo ', '; endif; ?>
                                    <?php endforeach; ?>
                                    </span>
                                    <span class="pull-right text-right"><a href="<?php echo REL_URL,'/channel/,$video['cslug'],'/">',e($video['cname']); ?></a></span>
</div>

Did not test this, if any bugs, let me know.


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

Offline

#5 2016-03-17 16:01:16

phseven
Member
Registered: 2011-06-02
Posts: 78

Re: Homepage mods

Query: SELECT v.video_id, v.title, v.slug, v.likes, v.rating, v.rated_by, v.duration, v.thumb, v.thumbs, v.total_views, v.add_time, v.ext, v.hd, v.premium, v.type, u.username, v.channel_id, c.name AS cname, c.slug AS cslug, GROUP_CONCAT(m.name) AS models, GROUP_CONCAT(m.slug) AS slugs FROM prvideo AS v LEFT JOIN pruser AS u ON (u.user_id = v.user_id) LEFT JOIN prchannel AS c ON (c.channel_id = v.channel_id) LEFT JOIN prmodel_videos AS mv ON (mv.video_id = v.video_id) LEFT JOIN prmodel AS m ON (m.model_id = mv.model_id) WHERE v.status = 1GROUP BY v.video_id ORDER BY v.add_time DESC LIMIT 20
Error Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'BY v.video_id ORDER BY v.add_time DESC LIMIT 20' at line 11
Error Number: 1064

Offline

#6 2016-03-18 05:48:29

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

Re: Homepage mods

there needs to be a space after WHERE v.status = 1...replace this $sql .= "GROUP BY v.video_id"; with $sql .= " GROUP BY v.video_id";


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

Offline

#7 2016-03-18 07:55:41

phseven
Member
Registered: 2011-06-02
Posts: 78

Re: Homepage mods

Done that and  all major errors gone

Just this one shows

Query:
Error Message:
Error Number: 0

Offline

#8 2016-03-19 08:09:34

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

Re: Homepage mods

Oki. I'll connect to your server and add this. Same server as the other sites? For which site is this btw?


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

Offline

#9 2016-03-19 10:17:58

phseven
Member
Registered: 2011-06-02
Posts: 78

Re: Homepage mods

I added the names already  jazziegirls.com/recent/   but  having trouble in adding click on models names > go to models page

yes same server

Offline

#10 2016-03-19 12:29:48

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

Re: Homepage mods

fixed


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

Offline

#11 2016-03-19 13:13:16

phseven
Member
Registered: 2011-06-02
Posts: 78

Re: Homepage mods

Thank you Adrien

Any reason why they disappear from home page ? but show in recent.

Offline

#12 2016-03-19 19:30:03

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

Re: Homepage mods

You need to modify modules/frontpage/frontpage.php also...all files that pull videos from the database...


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

Offline

Board footer

Powered by FluxBB