<?php
include('../../databaseconnect.php');
include('../../sitedetails.php');

mysqli_set_charset($con, "utf8mb4");

// Site configuration
$sitenameauthor = 'Mounika';
$sitecategorypatternurl =$cateurl;
// Author information
// Fetch posts by Mobcup
$sql = "SELECT URLSLIST, modified_date, ID FROM $tablename ORDER BY ID DESC ";
$result = $con->query($sql);
?>

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="Discover ringtones and BGM created by <?php echo $sitenameauthor; ?>. Explore the latest uploads of exclusive ringtones, audio edits, and BGMs only on <?php echo $sitenameauthor; ?> Ringtone Download.">
  <meta name="keywords" content="<?php echo $sitenameauthor; ?>, ringtone downloads, BGM ringtones, audio edits, exclusive ringtones, bgm download">
  <meta name="author" content="<?php echo $sitenameauthor; ?>">
  <meta property="og:type" content="website">
  <meta property="og:title" content="<?php echo $sitenameauthor; ?> - Ringtone Posts | BGM Ringtone Download">
  <meta property="og:description" content="Explore the latest exclusive ringtones and BGM posts by <?php echo $sitenameauthor; ?>. Visit the author profile for hand-picked ringtones and audio edits.">
  <meta property="og:url" content="<?php echo $siteurlnav; ?>/author/<?php echo $author; ?>/">
  <meta property="og:image" content="<?php echo $siteurlnav; ?>/assets/images/<?php echo $author; ?>-profile.jpg">
  
  <title><?php echo $sitenameauthor; ?> - Ringtone Posts | BGM Ringtone Download</title>

  <!-- FontAwesome for social icons -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
  
  <!-- Structured Data Schema Markup -->
  <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "Person",
      "name": "<?php echo $sitenameauthor; ?>",
      "url": "<?php echo $siteurlnav; ?>/author/<?php echo $author; ?>/",
      "sameAs": [
        "<?php echo $sitetelegramlink; ?>",
        "<?php echo $siteinstagramlink; ?>",
        "<?php echo $siteyoutubelink; ?>"
      ],
      "description": "<?php echo $sitenameauthor; ?> is a ringtone creator and audio editor specializing in BGM and ringtone edits for music lovers. Find exclusive ringtones and audio edits only on <?php echo $sitenameauthor; ?> Ringtone Download.",
      "image": "<?php echo $siteurlnav; ?>/assets/images/<?php echo $author; ?>-profile.jpg",
      "publisher": {
        "@type": "Organization",
        "name": "<?php echo $sitenameauthor; ?> Ringtone Download",
        "url": "<?php echo $siteurlnav; ?>"
      }
    }
  </script>

  <style>
    body {
      font-family: Arial, sans-serif;
      background: #f4f4f4;
      margin: 0;
      padding: 0;
    }
    .container {
      max-width: 800px;
      margin: 0 auto;
      background: white;
      padding: 20px;
    }
    .author-header {
      text-align: center;
    }
    .author-header h1 {
      font-size: 28px;
      margin-bottom: 10px;
    }
    .bio {
      color: #666;
      font-size: 15px;
      text-align: center;
      margin-bottom: 30px;
    }
    .ringtone {
      border-bottom: 1px solid #ddd;
      padding: 15px 0;
    }
    .ringtone a {
      font-size: 18px;
      color: #0073aa;
      text-decoration: none;
    }
    .ringtone a:hover {
      text-decoration: underline;
    }
    .ringtone small {
      color: #888;
    }

    /* Social icons style */
    .social-links {
      margin-top: 10px;
    }
    .social-links a {
      margin: 0 8px;
      font-size: 22px;
      color: #555;
      transition: color 0.3s ease;
    }
    .social-links a:hover {
      color: #e91e63;
    }

    .footer {
      text-align: center;
      color: #aaa;
      font-size: 13px;
      margin-top: 40px;
    }
  </style>
</head>
<body>
  <div class="container">
    <div class="author-header">
      <h1><?php echo $sitenameauthor; ?></h1>
      <div class="social-links">
        <a href="<?php echo $sitetelegramlink; ?>" target="_blank" title="Telegram"><i class="fab fa-telegram-plane"></i></a>
        <a href="<?php echo $siteinstagramlink; ?>" target="_blank" title="Instagram"><i class="fab fa-instagram"></i></a>
        <a href="<?php echo $siteyoutubelink; ?>" target="_blank" title="YouTube"><i class="fab fa-youtube"></i></a>
      </div>
    </div>

    <div class="bio">
      <?php echo $sitenameauthor; ?> is a renowned ringtone creator and audio editor, specializing in BGMs, exclusive ringtones, and custom audio edits. He brings the best handpicked and crafted ringtones for all music lovers. His ringtones range from popular BGMs to unique audio compositions. Explore his extensive collection below!
    </div>

    <h2>📱 <?php echo $sitenameauthor; ?>'s Ringtone Posts</h2>

    <?php
    if ($result && $result->num_rows > 0) {
      while ($row = $result->fetch_assoc()) {
        $fullUrl = $row["URLSLIST"];
        $date = date("F j, Y", strtotime($row["modified_date"]));

        // Extract slug from URL (last part after /)
        $slug = basename($fullUrl);
        $title = ucwords(str_replace('-', ' ', $slug));
        echo '<div class="ringtone">';
        echo '<a href="' . htmlspecialchars($siteurlnav) . htmlspecialchars($sitecategorypatternurl) . htmlspecialchars($slug) . '">' . htmlspecialchars($title) . '</a><br>';
        echo '<small>Last Updated on ' . htmlspecialchars($date) . '</small>';
        echo '</div>';
      }
    } else {
      echo "<p>No posts by " . htmlspecialchars($sitenameauthor) . " found.</p>";
    }

    $con->close();
    ?>

    <div class="footer">
      &copy; <?= date('Y') ?> <?php echo $sitenameauthor; ?> Ringtone Download. All rights reserved.
    </div>
  </div>
</body>
</html>