Adult Script Pro Community Forums

Create, help and share your ideas with the community!

You are not logged in.

#1 2016-05-17 14:37:11

hummy
Member
Registered: 2013-10-24
Posts: 17
Website

Same database for different domains?

Is it possible to use one database for 2 different domains on different servers?

Thanks

Offline

#2 2016-05-17 15:43:58

spankmonkey
Member
From: Detroit, MI
Registered: 2015-11-18
Posts: 37
Website

Re: Same database for different domains?

Yes and no... in theory you could use the same database, but you would have a lot of issues.

The two domains would have the same site name and meta information as well as settings, and a lot of your links would require manual rewriting.

You *could* make one big database and have different table prefixes and have each domain call a separate prefix, but doing this won't share members, photos or videos between sites and would make your SQL scream for mercy under a decent server load.

Your best option is to use remote SQL and just have two databases.  I currently have a VPS hosting account for my static files and conversion, but I use a dedicated for my databases.  In your config you just enter the IP address of your outside SQL host rather than the usual 'localhost' or your current hosting sql address.

Offline

#3 2016-05-17 16:22:53

hummy
Member
Registered: 2013-10-24
Posts: 17
Website

Re: Same database for different domains?

Thanks spankmonkey i will do with separate database, my vps is not so powerfull.

Offline

#4 2016-05-18 05:33:06

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

Re: Same database for different domains?

You can use one database for 2 sites, you need to have the same media folder for both sites (you can create a symbolic link). When you edit the config on one site the cache will be saved in the tmp/cache folder, so no need to edit for each site.


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

Offline

#5 2016-05-23 12:14:33

hummy
Member
Registered: 2013-10-24
Posts: 17
Website

Re: Same database for different domains?

Hi Adrian, so what I'm trying to do is get like a real multilanguage site with one database and 2 domains with their template at same server. I'm working for 2 languages now spanish and italian, I've added new columns at database for italian for example for video nameit descriptionit slugit and modified script and this part is working nice. Now the flag link go to the video of that language. The problem is with tag and category I tried linking tag and category with flag but is not working. How can i get nameit from video_tags and category nameit from categories?
Thanks

Offline

#6 2016-05-24 07:08:59

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

Re: Same database for different domains?

select group_concat(t.name) as tags, group_concat(c.name) as categories


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

Offline

#7 2016-05-24 23:06:13

hummy
Member
Registered: 2013-10-24
Posts: 17
Website

Re: Same database for different domains?

I tried all day and didn't get work, where should I have to put select group_concat(t.name) as tags

$query    = VUri::query();
        $tag     = (isset($query['1'])) ? $query['1'] : '';
        $page    = (isset($query['2'])) ? (int) $query['2'] : 1;
        $url    = 'tag/'.prepare_string($tag, true).'/';
        if ($page !== 0 && $page !== 1) {
            $url .= $page.'/';
        }
       
        if (!VUri::match($url)) {
            VModule::load('404', TRUE);
        }
       
        VLanguage::load('frontend.video');
        $tag            = str_replace('-', ' ', $tag);
        $tag            = utf8_strtolower($tag);
        $sql_count        = "SELECT COUNT(*) AS total_videos
                           FROM #__video_tags AS vt
                           WHERE vt.nameit = '".$this->db->escape($tag)."'";
        $total_videos    = $this->db->get_field($sql_count, 'total_videos');
        $pagination        = VPagination::get($page, $total_videos, $this->vcfg['tag_per_page']);
        $sql             = "SELECT v.video_id, v.titleit, v.slugit, v.title, v.slug, v.rating, v.rated_by, v.duration, v.thumb,
                                  v.thumbs, v.total_views, v.add_time, v.ext, v.premium, u.username
                           FROM #__video_tags AS vt
                           INNER JOIN #__video AS v ON (v.video_id = vt.video_id AND v.status = 1)
                           LEFT JOIN #__user AS u ON (u.user_id = v.user_id)
                           WHERE vt.nameit = '".$this->db->escape($tag)."'
                           ORDER BY v.video_id DESC
                           LIMIT ".$pagination['limit'];
        if (!$videos = $this->cache->get($sql, 86400)) {
            $this->db->query($sql);
            if ($this->db->affected_rows()) {
                $videos = $this->db->fetch_rows();
                $this->cache->store($sql, $videos, 86400);
            } else {
                $videos = array();

Offline

#8 2016-05-25 05:59:46

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

Re: Same database for different domains?

are you trying to get the tags and categories for a video or the videos that have a specific tag?


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

Offline

#9 2016-05-25 11:22:26

hummy
Member
Registered: 2013-10-24
Posts: 17
Website

Re: Same database for different domains?

category is working now
problem is with tag. i want to get video_tags name from db, example url for italian language http://website/tag/mature/  i want to link to spanish http://website/tag/madura/  db at video_tags i got nameit for italian and name for spanish

i think problem is getting $query for both languages at same time

Last edited by hummy (2016-05-25 11:50:54)

Offline

#10 2016-05-26 06:50:24

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

Re: Same database for different domains?

so i already have this implemented for the script, but it will only be available in 3.x. you need a new database structure, table tags contains the tags (tag_id, tag), table tags_translations contains the translations (tag_id, lang_id, tag) and table video_tags contains the relation between the tags and videos (tag_id, video_id)

dont know exactly how you can make it work with the current version of the script


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

Offline

#11 2016-05-29 06:27:33

tsaarinen
Member
Registered: 2013-11-03
Posts: 2

Re: Same database for different domains?

Hi.
May be a stupid question , but how to create symbolic link???

-Topi


symtab wrote:

You can use one database for 2 sites, you need to have the same media folder for both sites (you can create a symbolic link). When you edit the config on one site the cache will be saved in the tmp/cache folder, so no need to edit for each site.

Offline

#12 2016-05-30 04:39:24

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

Re: Same database for different domains?

ln -s /path/to/folder/or/file/you/want/to/link/to new-link-name


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

Offline

Board footer

Powered by FluxBB