I've been playing with this script for a few weeks now (I bought it before it got posted here) here's a few fixes...
404 error upon trying to install it:
Remove Options +FollowSymLinks from the .htaccess file
Genders only showing female after changing it to male:
app -> theme -> view -> common -> profile.general.php
Change line 29 to the following
HTML:
<div class="text">
<?php
if(strpos($Data['gender'], '1') !== false){
echo "Female";
} else {
echo "Male";
}
?>
</div>
How to create your own RSS Feed for social media automation:
Example RSS Feed: https://watcha.movie/feeds/all-rss.php
PHP:
<?php
include '../app/config/db.config.php'; // Database configuration
$link = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
$sql = "SELECT * FROM posts ORDER BY created DESC LIMIT 25";
$private = "2";
if ($result = mysqli_query($link, $sql))
{
if (mysqli_num_rows($result) > 0)
{
header("Content-type: text/xml");
echo "<?xml version='1.0' encoding='UTF-8'?>";
echo "<rss version='2.0'>";
echo "<channel>";
echo "<title>Most Recent RSS Feed</title>";
echo "<link>https://" . $_SERVER['SERVER_NAME'] . "</link>";
echo "<language>en</language>";
while ($row = mysqli_fetch_array($result))
{
if ($row['private'] == $private)
{
if(preg_match('/&/',$row['title'])){
}
else {
echo "<item>";
echo "<title>" . $row['title'] . "</title>";
echo "<link>https://" . $_SERVER['SERVER_NAME'] . "/" . $row['type'] . "/" . $row['self'] . "-" . $row['id'] . "</link>";
echo "<enclosure url='https://" . $_SERVER['SERVER_NAME'] . "/public/upload/cover/" . $row['image'] . "' length='174093' type='image/webp'/>";
echo "<pubDate>" . $row['created'] . "</pubDate>";
echo "</item>";
}
}
}
echo "</channel>";
echo "</rss>";
mysqli_free_result($result);
}
else
{
echo "No records matching your query were found.";
}
}
else
{
echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
}
mysqli_close($link);
?>
This does numerous things, due to XML limitations this excludes any movie or tv show titles with the "&" symbol in it, it also doesn't add content which is still set to private as presumably you haven't provided a link for it yet.
Create sitemap for Google Search Console:
Example sitemap https://watcha.movie/sitemap.xml
Here's the cronjob I use to generate sitemap.xml for google search console. I use cron to run this once a day and it generates sitemap.xml, I coded this lazily unlike the rss feed so you'll need to change the URL's in this one sorry.
PHP:
<?php
include '../db.config.php'; // Database configuration
$link = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
$sql = "SELECT * FROM posts ORDER BY created DESC";
$file = '../../../sitemap.xml';
$private = "2";
ob_start();
if ($result = mysqli_query($link, $sql))
{
if (mysqli_num_rows($result) > 0)
{
header("Content-type: text/xml");
echo "<?xml version='1.0' encoding='UTF-8'?>";
echo "<urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd'>";
echo "<url><loc>https://watcha.movie/</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>1.00</priority></url>";
echo "<url><loc>https://watcha.movie/register</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.80</priority></url>";
echo "<url><loc>https://watcha.movie/login</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.80</priority></url>";
echo "<url><loc>https://watcha.movie/discovery</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.80</priority></url>";
echo "<url><loc>https://watcha.movie/movies</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.80</priority></url>";
echo "<url><loc>https://watcha.movie/categories</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.80</priority></url>";
echo "<url><loc>https://watcha.movie/page/about</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.80</priority></url>";
echo "<url><loc>https://watcha.movie/page/terms-and-conditions</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.80</priority></url>";
echo "<url><loc>https://watcha.movie/page/privacy-policy</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.80</priority></url>";
echo "<url><loc>https://watcha.movie/page/create-a-mirror</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.80</priority></url>";
echo "<url><loc>https://watcha.movie/page/affiliates</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.80</priority></url>";
echo "<url><loc>https://watcha.movie/page/dmca</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.80</priority></url>";
echo "<url><loc>https://watcha.movie/page/rss-feeds</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.80</priority></url>";
echo "<url><loc>https://watcha.movie/forgot-password</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.64</priority></url>";
echo "<url><loc>https://watcha.movie/category/action</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.64</priority></url>";
echo "<url><loc>https://watcha.movie/category/adventure</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.64</priority></url>";
echo "<url><loc>https://watcha.movie/category/animation</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.64</priority></url>";
echo "<url><loc>https://watcha.movie/category/comedy</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.64</priority></url>";
echo "<url><loc>https://watcha.movie/category/crime</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.64</priority></url>";
echo "<url><loc>https://watcha.movie/category/documentary</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.64</priority></url>";
echo "<url><loc>https://watcha.movie/category/drama</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.64</priority></url>";
echo "<url><loc>https://watcha.movie/category/family</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.64</priority></url>";
echo "<url><loc>https://watcha.movie/category/fantasy</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.64</priority></url>";
echo "<url><loc>https://watcha.movie/category/history</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.64</priority></url>";
echo "<url><loc>https://watcha.movie/category/horror</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.64</priority></url>";
echo "<url><loc>https://watcha.movie/category/music</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.64</priority></url>";
echo "<url><loc>https://watcha.movie/category/mystery</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.64</priority></url>";
echo "<url><loc>https://watcha.movie/category/romance</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.64</priority></url>";
echo "<url><loc>https://watcha.movie/category/science-fiction</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.64</priority></url>";
echo "<url><loc>https://watcha.movie/category/thriller</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.64</priority></url>";
echo "<url><loc>https://watcha.movie/category/tv-movie</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.64</priority></url>";
echo "<url><loc>https://watcha.movie/category/war</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.64</priority></url>";
echo "<url><loc>https://watcha.movie/category/western</loc><lastmod>2021-05-06T23:23:07+00:00</lastmod><priority>0.64</priority></url>";
while ($row = mysqli_fetch_array($result))
{
if ($row['private'] == $private)
{
if(preg_match('/&/',$row['title'])){
}
else {
echo "<url>";
echo "<loc>https://watcha.movie/" . $row['type'] . "/" . $row['self'] . "-" . $row['id'] . "</loc>";
echo "<priority>0.51</priority>";
echo "</url>";
}
}
}
echo "</urlset>";
mysqli_free_result($result);
}
else
{
echo "No records matching your query were found.";
}
}
else
{
echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
}
$htmlStr = ob_get_contents();
ob_end_clean();
file_put_contents($file, $htmlStr);
mysqli_close($link);
?>