OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/09/2025 11:18:49 AM
rwxr-xr-x
📄
.browserslistrc
208 bytes
02/11/2020 10:49:08 AM
rw-rw-r--
📄
.gitignore
42 bytes
02/11/2020 10:49:08 AM
rw-rw-r--
📄
.htaccess
803 bytes
07/18/2023 08:55:06 AM
rw-r--r--
📄
.htaccess.swp
12 KB
08/13/2021 06:21:55 AM
rw-r--r--
📄
.travis.yml
199 bytes
02/11/2020 10:49:16 AM
rw-rw-r--
📁
.well-known
-
11/28/2024 11:03:35 AM
rwxr-xr-x
📁
API
-
08/07/2024 07:35:13 AM
rwxr-xr-x
📁
_backup
-
06/22/2024 04:05:28 AM
rwxr-xr-x
📄
about.html
3.05 KB
06/15/2021 04:56:35 AM
rw-r--r--
📄
activate.php
2.56 KB
01/10/2021 11:01:39 AM
rw-r--r--
📁
admin
-
11/12/2024 08:53:01 AM
rwxr-xr-x
📄
article.php
17.24 KB
08/08/2024 12:15:43 PM
rw-r--r--
📁
arvindfacebook
-
08/14/2024 11:07:25 AM
rwxr-xr-x
📁
audio
-
04/16/2025 05:06:46 AM
rwxrwxrwx
📁
aws-ses
-
11/11/2024 12:41:09 PM
rwxr-xr-x
📄
back-dashboard.php
8.33 KB
07/25/2024 04:55:30 PM
rw-r--r--
📄
barticle.php
16.58 KB
07/22/2024 11:38:48 AM
rw-r--r--
📄
bin_article.php
6.62 KB
07/10/2024 07:41:53 AM
rw-r--r--
📄
bnewsletter.php
1.33 KB
08/08/2024 11:26:41 AM
rw-r--r--
📄
bview.php
14.07 KB
07/22/2024 07:30:50 AM
rw-r--r--
📁
clients
-
10/30/2024 11:05:12 AM
rwxr-xr-x
📄
contact.html
2.79 KB
06/15/2021 04:53:32 AM
rw-r--r--
📁
conversations
-
07/10/2024 06:53:08 AM
rwxr-xr-x
📁
covid
-
04/29/2021 04:36:04 PM
rwxr-xr-x
📁
creamapi
-
10/22/2024 10:53:04 AM
rwxrwxrwx
📄
dashboard.php
9.94 KB
04/16/2025 04:53:21 AM
rw-r--r--
📁
data
-
08/22/2020 09:10:30 AM
rwxrwxrwx
📄
down.html
1.23 KB
06/08/2021 03:26:16 PM
rw-r--r--
📁
downloads
-
11/10/2024 09:51:33 AM
rwxrwxrwx
📁
eSamudaay
-
10/10/2024 10:20:39 AM
rwxr-xr-x
📁
facebook
-
10/14/2024 07:24:26 AM
rwxr-xr-x
📄
fb_access.php
855 bytes
05/04/2021 04:21:24 AM
rw-r--r--
📁
galaxy
-
08/26/2024 06:22:21 AM
rwxr-xr-x
📄
gen2_1.php
45.17 KB
06/18/2024 09:16:17 AM
rw-r--r--
📁
genai
-
09/17/2024 07:46:25 AM
rwxr-xr-x
📄
geo_location.php
3.69 KB
08/07/2024 10:52:37 AM
rw-r--r--
📁
grfx
-
08/22/2020 01:22:42 PM
rwxr-xr-x
📁
groupchat
-
08/31/2024 11:08:59 AM
rwxr-xr-x
📁
hps
-
10/28/2024 10:38:34 AM
rwxr-xr-x
📁
img
-
09/16/2024 11:54:26 AM
rwxrwxrwx
📁
inc
-
03/04/2025 03:52:11 AM
rwxr-xr-x
📄
index.html
21.27 KB
10/09/2024 08:44:24 AM
rw-r--r--
📄
info.php
14 bytes
10/02/2020 04:48:53 AM
rw-r--r--
📁
knaadu
-
01/27/2024 09:01:23 AM
rwxr-xr-x
📁
knoblyExpressLandingPage
-
08/21/2024 10:01:16 AM
rwxr-xr-x
📁
live
-
03/11/2022 08:19:30 AM
rwxr-xr-x
📁
mailer_images
-
03/01/2023 03:50:20 AM
rwxr-xr-x
📁
mhd
-
09/05/2024 08:18:56 AM
rwxr-xr-x
📄
more.php
7.36 KB
06/25/2021 02:14:38 PM
rw-r--r--
📁
newgalaxy
-
11/22/2024 06:02:02 AM
rwxr-xr-x
📁
newsapi
-
06/19/2024 06:43:29 AM
rwxr-xr-x
📄
newsletter.php
1.33 KB
08/08/2024 12:14:17 PM
rw-r--r--
📁
oauth
-
01/26/2024 03:40:40 PM
rwxr-xr-x
📄
old1dashboard.php
8.4 KB
07/02/2024 11:18:03 AM
rw-r--r--
📄
olddashboard.php
11.58 KB
07/26/2024 06:11:34 AM
rw-r--r--
📁
postarticle
-
03/15/2024 03:05:03 AM
rwxrwxrwx
📄
privacy.html
9.99 KB
06/15/2021 04:53:16 AM
rw-r--r--
📁
process
-
03/04/2025 03:53:29 AM
rwxr-xr-x
📁
reeliv
-
09/04/2024 11:00:16 AM
rwxr-xr-x
📄
refund.html
7.34 KB
06/15/2021 04:53:16 AM
rw-r--r--
📄
reset.html
3.01 KB
06/15/2021 04:53:17 AM
rw-r--r--
📁
sendy
-
11/18/2021 09:43:15 AM
rwxr-xr-x
📄
showcase.php
7.93 KB
02/16/2024 04:22:28 AM
rw-r--r--
📄
signup.html
8.08 KB
07/05/2021 07:28:05 AM
rw-r--r--
📁
social_media
-
10/16/2024 12:36:51 PM
rwxr-xr-x
📄
splash.html
1.11 KB
01/10/2021 12:49:20 PM
rw-r--r--
📄
test.email.php
2.5 KB
06/13/2024 06:52:38 AM
rw-r--r--
📄
test.php
969 bytes
02/21/2023 04:35:32 AM
rw-r--r--
📁
testing
-
10/10/2024 05:27:49 AM
rwxr-xr-x
📁
texttovoice
-
07/16/2024 06:14:42 AM
rwxr-xr-x
📄
usage.html
30.88 KB
06/15/2021 04:53:17 AM
rw-r--r--
📁
venv
-
05/09/2024 06:58:41 AM
rwxr-xr-x
📁
videoAI
-
09/16/2024 01:25:53 PM
rwxr-xr-x
📄
view.php
12.44 KB
11/13/2024 03:42:52 AM
rw-r--r--
📁
zaws-ses
-
10/23/2024 05:53:49 AM
rwxr-xr-x
📁
znew1aws-ses
-
08/16/2024 08:24:03 AM
rwxr-xr-x
📄
zview.php
16.09 KB
07/22/2024 10:53:51 AM
rw-r--r--
📁
zzaws-ses
-
10/04/2024 04:34:42 AM
rwxr-xr-x
Editing: gen2_1.php
Close
<?php // Start or resume the session session_start(); include '../inc/validate.logged.php'; include '../inc/config.php'; // Corrected the path // Define system prompts for various scenarios $system_prompts = array( "#todo" => "Convert the text that follows as a todo item.", "#post" => "Convert the text that follows as a social post.", "#joke" => "use text as a context or theme to write a joke.", "#note" => "Convert the text that follows as a note.", "#bored" => "Respond with a motivational anecdote especially from among Robin Williams, Emerson, Mark Twain, Jim Rohn, Dale Carnegie, Simon Sinek", "#advise" => "Take the following text to give me advise with anecdotes on how it was done by someone else.", "#done" => "Congratulate me and make me feel on top of the world.", "#working" => "help me keep my focus on the current work.", "#continue" => "Answer within the context of : " . end($_SESSION), "#tran-ek" => "Convert the text that follows into Kannada language", "#tran-ke" => "Convert the text in kannada that follows into English language", "#reporter" => "Convert the text that follows as a newspaper report", "#ben" => "Respond like you are Ben Franklin, picking from your writings and thoughts and motivating and guiding.", "#list" => "Respond with html entities that can be rendered directly without postprocessing. Add a html break entity after each item.", "#real-estate" => "Bot that specifically designed to answer related to the real estate in Bengaluru" ); if ($_SERVER["REQUEST_METHOD"] == "POST") { // Clear the generated content if the "Clear" button is clicked if (isset($_SESSION['working_headline'])) { $working_headline = $_SESSION['working_headline']; } else { $working_headline = ''; } if (isset($_POST['clear'])) { unset($_SESSION['working_headline']); // Redirect back to the same page to clear the displayed content header("Location: {$_SERVER['REQUEST_URI']}"); exit(); } if (isset($_POST['reset'])) { if (isset($_SESSION['working_headline'])) { unset($_SESSION['working_headline']); } if (isset($_SESSION['generated_content'])) { unset($_SESSION['generated_content']); } // Redirect back to the same page to clear the displayed content header("Location: {$_SERVER['REQUEST_URI']}"); exit(); } // Generate new content if the form is submitted else { // Get form data $working_headline = $_POST["working_headline"]; $num_words = 500; // Set your API key $apiKey = "sk-proj-FrlWqCTIyid7DZGorv0uT3BlbkFJzqrUB0km57kpp4aFPNV7"; // Set the endpoint URL for chat completions $url = "https://api.openai.com/v1/chat/completions"; // Preprocess system prompts $system_prompt = ""; foreach ($system_prompts as $trigger => $response) { if (strpos($working_headline, $trigger) === 0) { $system_prompt = "System: " . $response; // Remove the trigger from the input $working_headline = substr($working_headline, strlen($trigger)); break; } } // Set the request data with a chat-based model and messages parameter $data = array( "model" => "gpt-4-turbo", "messages" => array( array( "role" => "system", "content" => "System: Try to complete the sentence even if the max_tokens is reached." ), array( "role" => "system", "content" => "System: Always use mysql compatible svg embeds to show icons or images if you are using them to pepper the response." ), array( "role" => "system", "content" => $system_prompt ), array( "role" => "user", "content" => "You: $working_headline." ) ), "max_tokens" => $num_words ); // Initialize cURL $ch = curl_init(); // Set cURL options curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Content-Type: application/json", "Authorization: Bearer $apiKey" )); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Execute the request $response = curl_exec($ch); // Close cURL curl_close($ch); // Decode JSON response $result = json_decode($response, true); // Extract the total_tokens $totalTokens = $result['usage']['total_tokens']; // Get the generated content $new_content = $result['choices'][0]['message']['content']; // Append the new content to the existing content if (!isset($_SESSION['generated_content'])) { $_SESSION['generated_content'] = ""; } $_SESSION['generated_content'] .= "<br><br>" . $new_content; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Knobly Cream GenAI</title> <!-- Bootstrap CSS --> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"> <!-- Font Awesome CSS --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"> <!-- Custom CSS --> <link rel="stylesheet" href="/styles.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"> <!-- jQuery --> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <!-- This is the code sourced from the dashboard.php --> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.0.0/animate.min.css" /> <link rel="stylesheet" href="../inc/fontawesome/css/all.min.css" /> <link rel="stylesheet" href="../inc/magnific-popup.css" /> <link rel="stylesheet" href="../inc/style.css" /> <script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.js" crossorigin="anonymous"></script> <script src="https://cdn.tiny.cloud/1/u5oz235qw5jiqww4udm90ocp9zg2rncblqo2ch0ym3twjgyt/tinymce/5/tinymce.min.js" referrerpolicy="origin"></script> <script src="https://js.zohostatic.com/books/zfwidgets/assets/js/zf-widget.js"></script> <script src="/inc/jquery.magnific-popup.min.js"></script> <script src="/inc/common.js"></script> <script type="text/javascript"> function hideAIcontent() { $('#mainContent').hide(); } </script> <style> body, html { height: 100%; margin: 0; display: flex; flex-direction: column; } .content { flex: 1; display: flex; flex-direction: column; } .footer { background-color: #f8f9fa; text-align: center; padding: 10px 0; position: relative; width: 100%; bottom: 0; } .tips-button { position: absolute; top: 10px; right: 10px; font-size: 0.9rem; color: #007bff; cursor: pointer; z-index: 10; } .modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0, 0, 0, 0.5); } .modal-content { background-color: #f9f9f9; margin: 10% auto; padding: 20px; border: 1px solid #888; width: 80%; max-width: 600px; border-radius: 10px; } .close { color: #aaa; float: right; font-size: 28px; font-weight: bold; } .close:hover, .close:focus { color: black; text-decoration: none; cursor: pointer; } .tips-content { font-size: 0.9rem; color: #333; } @media (max-width: 768px) { .tips-button { top: 50px; right: 10px; font-size: 0.8rem; } .container { text-align: center; } header img { max-width: 150px; margin-bottom: 20px; } } /* New styles for the generated content area */ .generated-content { max-height: 300px; /* Adjust as needed */ overflow-y: auto; border: 1px solid #ddd; padding: 10px; border-radius: 5px; } .lead { font-size: 16px; } .copy-button { background-color: transparent; border: 1px solid #007bff; color: #007bff; padding: 5px 10px; border-radius: 3px; cursor: pointer; font-size: 0.8rem; } .copy-button:hover { background-color: #ffffff; color: white; } /* css for dropdown */ /* Style the dropdown container */ .dropdown { position: relative; display: inline-block; } /* Style the button that will trigger the dropdown */ .dropdown-button { background-color: #f26522; border-radius: 5px; color: white; padding: 10px 20px; font-size: 16px; border: none; cursor: pointer; } /* Style the dropdown content (hidden by default) */ .dropdown-content { display: none; position: absolute; background-color: #f9f9f9; min-width: 160px; max-height: 200px; /* Maximum height of dropdown content */ overflow-y: auto; /* Enable vertical scrollbar if content exceeds max-height */ box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2); z-index: 1; } /* Style the links inside the dropdown */ .dropdown-content option { color: black; padding: 12px 16px; text-decoration: none; display: block; } /* Change color of dropdown links on hover */ .dropdown-content option:hover { background-color: #f1f1f1; } /* Show the dropdown menu on hover */ .dropdown:hover .dropdown-content { display: block; } .classReset:hover { background-color: #cb2626; } .button-container { display: flex; flex-wrap: wrap; justify-content: left; align-items: center; border-bottom: 1px solid #ccc; padding-bottom: 10px; margin-bottom: 20px; } .button-container button { display: grid; border: 1px solid black; border-radius: 2px; background-color: transparent; border: none; cursor: pointer; outline: none; } .button-container button .dropdown-icon { margin-right: 5px; } .main-container { display: flex; flex: auto; } .clear-text { opacity: 0; /* Initially hide the text */ transition: opacity 0.3s ease; /* Add transition effect */ } .button-bar { display: flex; justify-content: space-between; } .gen3 { background-color: #f26522; border: 1px #f26522; /* border-radius: 2px; */ } .gen3:hover { background-color: #CF551D; border: 1px #CF551D; /* border-radius: 2px; */ } .button-bar { width: 100%; /* top: 0; */ overflow-x: hidden; padding-top: 20px; } .left { display: flex; justify-content: space-between; width: 40%; left: 0; /* background-color: #111; */ } /* Control the right side */ .right { right: 0; /* background-color: red; */ } .content-container { padding-bottom: 4rem !important; } </style> </head> <body class="sb-nav-fixed"> <!-- Nav bar --> <nav class="sb-topnav navbar navbar-expand navbar-dark bg-dark"> <a class="navbar-brand" href="/dashboard.php"><img src="/grfx/logo.png" width="120"></a> <button class="btn btn-link btn-sm order-1 order-lg-0" id="sidebarToggle" href="#"><i class="fas fa-bars"></i></button> <div class="navbar-nav ml-auto"> <div class="navbar-nav text-light" style="margin-top:6px;margin-right:20px"><?= strtok($gUserName, " "); ?></div> <div class="navbar-nav text-light" style="margin-top:6px;margin-right:20px"><? if ($gUserPlan == 1) { ?>Pro<? } else { ?>Free<? } ?></div> <div class="navbar-nav text-light cursorH" style="margin-top:10px;margin-right:10px" onclick="goSection('utils','','showNotifications')"><i class="fas fa-bell"></i></div> <ul class="navbar-nav ml-md-0"> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" id="userDropdown" href="#" role="button" data-toggle="dropdown"><i class="fas fa-user fa-fw"></i></a> <div class="dropdown-menu dropdown-menu-right"> <a class="dropdown-item" href="javascript:goSection('account')">My Account</a> <a class="dropdown-item" href="javascript:goSection('settings')">My Settings</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="../process/logout.php" onclick="removeSignedIn()">Logout</a> </div> </li> </ul> </div> </nav> <div id="layoutSidenav"> <div id="layoutSidenav_nav"> <nav class="sb-sidenav accordion sb-sidenav-dark" id="sidenavAccordion"> <div class="sb-sidenav-menu"> <div class="nav mt-4 "> <!-- <a class="nav-link active" href="javascript:np()" onclick="goSection('dashboard', this)"><div class="sb-nav-link-icon"><i class="fas fa-rss"></i></div> Dashboard</a> --> <a class="nav-link" href="javascript:np()" onclick="goSection('curated', this); hideAIcontent();"> <div class="sb-nav-link-icon"><i class="fas fa-rss"></i></div> Cream Curated </a> <a class="nav-link" href="javascript:np()" onclick="goSection('feed', this); hideAIcontent();"> <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div> My Feeds </a> <a class="nav-link" href="javascript:np()" onclick="goSection('collection', this)"> <div class="sb-nav-link-icon"><i class="fas fa-save"></i></div> My Collections </a> <a class="nav-link" href="javascript:np()" onclick="goSection('community', this); hideAIcontent();"> <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div> Community Feeds(Beta) </a> <a class="nav-link" href="javascript:np()" onclick="goSection('team', this); hideAIcontent();"> <div class="sb-nav-link-icon"><i class="fas fa-book-open"></i></div> Our Team(Beta) </a> <a class="nav-link" href="javascript:np()" onclick="goSection('create', this); hideAIcontent();"> <div class="sb-nav-link-icon"><i class="fa fa-plus"></i></div> Create </a> <a class="nav-link" href="javascript:np()" onclick="goSection('newsletter', this); hideAIcontent();"> <div class="sb-nav-link-icon"><i class="fas fa-newspaper"></i></div> Newsletter </a> <a class="nav-link" href="https://knoblycream.com/sendy" target=_blank> <div class="sb-nav-link-icon"><i class="fa-solid fa-paper-plane"></i></div> Mailer Campaign </a> <!-- <a class="nav-link" href="https://knoblycream.com/genai/gen2.php" target=_blank> <div class="sb-nav-link-icon"><i class="fa fa-rocket"></i></div> GenAI Creator </a> --> <a class="nav-link" href="/gen2_1.php" target=_blank> <div class="sb-nav-link-icon"><i class="fa fa-rocket"></i></div> GenAI Creator </a> <a class="nav-link" href="javascript:np()" onclick="goSection('request.article', this); hideAIcontent();"> <div class="sb-nav-link-icon"><i class="far fa-map"></i></div> Request Article </a> <a class="nav-link" href="javascript:np()" onclick="goSection('analytics', this); hideAIcontent();"> <div class="sb-nav-link-icon"><i class="fa fa-chart-line"></i></div> Analytics </a> </div> </div> <div class="sb-sidenav-footer"> <div class="small">Version: 2.1</div> </div> </nav> </div> <!-- GenAI content --> <div id="layoutSidenav_content"> <main> <div id="panelContent" class="container-fluid"></div> <div id="mainContent" class="main-container"> <div class="content"> <div class="container my-4" style="padding-bottom: 4rem ;"> <ol class="breadcrumb my-3"> <li class="breadcrumb-item"> <h4 class="m-0">GenAI</h4> </li> </ol> <div class="button-bar"> <div class="button-container left"> <button class="dropdown-option" value="#reporter" title="Convert the text that follows as a newspaper report"> <i class="fas fa-newspaper dropdown-icon"></i> Report </button> <button class="dropdown-option" value="#tran-ek" title="Convert the text that follows into Kannada language"> <i class="fas fa-exchange-alt dropdown-icon"></i> Tran-ek </button> <button class="dropdown-option" value="#tran-ke" title="Convert the text in kannada that follows into English language"> <i class="fas fa-exchange-alt dropdown-icon"></i> Tran-ke </button> <button class="dropdown-option" value="#list" title="Respond with html entities that can be rendered directly without postprocessing. Add a html break entity after each item."> <i class="fas fa-list dropdown-icon"></i> List </button> <button class="dropdown-option" value="#post" title="Convert the text that follows as a social post."> <i class="fas fa-image"></i> Post </button> <button class="dropdown-option" value="#note" title="Convert the text that follows as a note."> <i class="fas fa-sticky-note dropdown-icon"></i> Note </button> <button class="dropdown-option" value="#real-estate" title="Bot that specifically designed to answer related to the real estate in Bengaluru"> <i class="fas fa-building"></i> Real Estate </button> </div> <div class=" gen3-button right"> <div class="data col-12 col-md-7 text-center text-md-right 1mt-2 1m-mt-0" data-feed-id="<?= $collectionId ?>" data-feed-title="<?= $collectionTitle ?>" data-feed-url="<?= $collectionLinkFull ?>" data-feed-publisher="<?= $collectionPublisher ?>"> <!-- <label class="btn-secondary m-0 px-2 py-1" style="user-select:none"><input type="checkbox" name="feedData" onclick="addNewsletter()"> Send to Newsletter</label> <label class="buttonCreamShare btn-info m-0 px-2 py-1 mr-2" data-id="<?= $collectionId ?>" style="user-select:none">Cream<i>Share</i></label> <a href="#"><i data-id="<?= $collectionId ?>" class="emailRow fas fa-2x fa-envelope-square" style="position:relative;top:5px;color:#f58020;"></i></a> <a data-sbg-1="" data-sbg-2="" data-sbg-3="" class="sbg-button pt-1" data-sbg-network="facebook" data-sbg-width="600" data-sbg-height="368"><i class="mt-1 fab fa-facebook-square fa-2x cursorH" style="position:relative;top:5px;color:#f58020;"></i></a> <a data-sbg-1="" data-sbg-2="" data-sbg-3="" class="sbg-button" data-sbg-network="twitter" data-sbg-width="600" data-sbg-height="258"><i class="fab fa-twitter-square fa-2x cursorH" style="position:relative;top:5px;color:#f58020;"></i></a> <a data-sbg-1="" data-sbg-2="" data-sbg-3="" class="sbg-button" data-sbg-network="linkedin" data-sbg-width="585" data-sbg-height="471"><i class="fab fa-linkedin fa-2x cursorH" style="position:relative;top:5px;color:#f58020;"></i></a> <a data-sbg-1="" data-sbg-2="" data-sbg-3="" class="sbg-button" data-sbg-network="pinterest" data-sbg-width="600" data-sbg-height="368"><i class="fab fa-pinterest-square fa-2x cursorH" style="position:relative;top:5px;color:#f58020;"></i></a> --> </div> <?php $encoded_text = ""; if (isset($_POST['working_headline'])) { $encoded_text .= $_POST['working_headline']; $encoded_text .= " "; } if (isset($_SESSION['generated_content'])) { $encoded_text .= $_SESSION['generated_content']; } $encoded_text = str_replace("<br>", "\n", $encoded_text); // $encoded_text = $_SESSION["generated_content"]; ?> <a href="http://web.whatsapp.com/send?text=<?= $encoded_text; ?>" target="_blank"> <i class="fab fa-2x fa-whatsapp-square" style="position:relative;top:5px;color:#f58020;"></i> </a> <a href="/genai/gen2_1_1.php"><button class="btn btn-primary gen3">Try Creative</button></a> </div> </div> <form method="post" action=""> <div class="form-group" style="margin-top:1rem"> <!-- <label for="working_headline"></label> --> <textarea name="working_headline" placeholder="Enter your working headline..." id="working_headline" class="form-control" rows="2"><?php if (isset($_POST['working_headline'])) echo htmlspecialchars($_POST['working_headline']); ?></textarea> </div> <div class="form-group flex space-between"> <button type="submit" class="btn btn-primary">Generate</button> <button type="submit" name="clear" class="btn btn-secondary"><i class="fas fa-eraser"></i> Clear</button> <button type="submit" name="reset" class="float-right btn btn-secondary classReset"><i class="fas fa-trash-alt"></i> Reset</i></button> </div> </form> <?php if (isset($_SESSION['generated_content']) && !empty($_SESSION['generated_content'])) : ?> <div class="generated-content border bg-white p-3 mt-3"> <div class="content-show" style="display: flex; justify-content:space-between"> <h5>Generated Content:</h5> <div class="button-content" style="display: flex; justify-content:right"> <button onclick="copyText()" class=" btn btn-warning " style="border: none; background:transparent"> <span> <i class="far fa-copy fa-lg fa-fw"></i> </span> </button> <!-- Want to add the share button --> <!-- <button onclick="copyText()" class=" btn btn-warning " style="border: none; background:transparent"> <span> <i class="far fa-copy fa-lg fa-fw"></i> </span> </button> --> </div> </div> <p><?php echo $_SESSION['generated_content']; ?> <br> </p> <form method="post" action='genai_save.php'> <input type="hidden" name="generated_content" value="<?php echo $_SESSION['generated_content']; ?>" /> <input type="hidden" name="working_headline" value="<?php echo $working_headline; ?>" /> <input class="float-right btn btn-primary" type="submit" value="Save"> </form> </div> <?php endif; ?> </div> </div> </div> </main> </div> </div> <footer class="footer" style="bottom: 1 px; position:relative"> <div class="container"> <span class="text-muted">© 2024 Knobly Cream. All rights reserved.</span> <span id="tipsButton" class="tips-button">Need Tips?</span> </div> </footer> <div id="tipsModal" class="modal"> <div class="modal-content"> <span class="close">×</span> <div class="tips-content"> <h5>Tips for Using Knobly Cream:</h5> <p><strong>#todo:</strong> Convert the text that follows as a todo item.</p> <p><strong>#post:</strong> Convert the text that follows as a social post.</p> <p><strong>#joke:</strong> use text as a context or theme to write a joke.</p> <p><strong>#note:</strong> Convert the text that follows as a note.</p> <p><strong>#bored:</strong> Respond with a motivational anecdote especially from among Robin Williams, Emerson, Mark Twain, Jim Rohn, Dale Carnegie, Simon Sinek</p> <p><strong>#advise:</strong> Take the following text to give me advise with anecdotes on how it was done by someone else.</p> <p><strong>#done:</strong> Congratulate me and make me feel on top of the world.</p> <p><strong>#working:</strong> help me keep my focus on the current work.</p> <p><strong>#continue:</strong> Answer within the context of : [Last Session Entry]</p> <p><strong>#tran-ek:</strong> Convert the text that follows into Kannada language</p> <p><strong>#tran-ke:</strong> Convert the text in kannada that follows into English language</p> <p><strong>#reporter:</strong> Convert the text that follows as a newspaper report</p> <p><strong>#ben:</strong> Respond like you are Ben Franklin, picking from your writings and thoughts and motivating and guiding.</p> <p><strong>#list:</strong> Respond with html entities that can be rendered directly without postprocessing. Add a html break entity after each item.</p> </div> </div> </div> <script> function copyText() { // Get the generated content var text = <?php echo json_encode(strip_tags($_SESSION['generated_content'])); ?>; // Create a temporary textarea element var textarea = document.createElement("textarea"); textarea.value = text; document.body.appendChild(textarea); textarea.select(); try { // Copy the text var successful = document.execCommand('copy'); if (successful) { alert('Text copied to clipboard'); } else { alert('Failed to copy text'); } } catch (err) { alert('Oops, unable to copy'); } // Remove the temporary textarea document.body.removeChild(textarea); } // JavaScript to handle the modal var modal = document.getElementById("tipsModal"); var btn = document.getElementById("tipsButton"); var span = document.getElementsByClassName("close")[0]; btn.onclick = function() { modal.style.display = "block"; } span.onclick = function() { modal.style.display = "none"; } window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } } </script> <!-- This js work is for dropdown, append the avatar --> <script> // Get the dropdown content element var dropdownContent = document.querySelector('.dropdown-content'); // Get the text area element var textArea = document.getElementById('working_headline'); // Add click event listener to the dropdown content dropdownContent.addEventListener('click', function(event) { // Check if clicked element is an option if (event.target.tagName === 'OPTION') { // Append the value of the selected option to the text area textArea.value += event.target.value; } }); </script> <script> document.addEventListener('DOMContentLoaded', function() { var dropdownOptions = document.querySelectorAll('.dropdown-content option'); dropdownOptions.forEach(function(option) { option.addEventListener('click', function() { var dropdownContent = this.parentNode; dropdownContent.style.display = 'none'; }); }); var dropdownButton = document.querySelector('.dropdown-button'); var dropdownContent = document.querySelector('.dropdown-content'); var textBox = document.getElementById('avatar-textbox'); dropdownButton.addEventListener('click', function() { dropdownContent.style.display = (dropdownContent.style.display === 'block') ? 'none' : 'block'; }); }); </script> <script> document.addEventListener('DOMContentLoaded', function() { var dropdownOptions = document.querySelectorAll('.dropdown-option'); var dropdownContent = document.querySelector('.dropdown-content'); dropdownOptions.forEach(function(option) { option.addEventListener('click', function() { var textArea = document.getElementById('working_headline'); textArea.value += this.getAttribute('value'); // Append the value of the clicked option // Hide the dropdown content after selecting an option dropdownContent.style.display = 'none'; }); }); var dropdownButton = document.querySelector('.dropdown-button'); dropdownButton.addEventListener('click', function() { dropdownContent.style.display = 'block'; }); }); </script> <script type="text/javascript"> $(function() { $('.buttonCreamShare').magnificPopup({ type: 'ajax', closeBtnInside: true, ajax: { settings: { method: 'POST', url: 'process/get.section.utils.php' } }, callbacks: { elementParse: function(item) { var data = $(item.el[0]).closest('.data'); postData = { act: 'showCreamShare', id: $(item.el[0]).data('id') } this.st.ajax.settings.data = postData; } } }); $('.editRow').magnificPopup({ type: 'ajax', closeBtnInside: true, ajax: { settings: { method: 'POST', url: 'process/get.section.collection.php' } }, callbacks: { open: function() { $.magnificPopup.instance._onFocusIn = function(e) { if ($(e.target).closest('.mce-window')) { return true; } $.magnificPopup.proto._onFocusIn.call(this, e); }; }, elementParse: function(item) { postData = { act: 'editForm', id: $(item.el[0]).data('id') } this.st.ajax.settings.data = postData; }, ajaxContentAdded: function(e) { tinymce.remove(); tinymce.init({ selector: 'textarea#postBody', height: 400, statusbar: false, forced_root_block: '', force_br_newlines: true, force_p_newlines: false, file_picker_types: 'image', automatic_uploads: true, paste_data_images: true, invalid_elements: 'span', extended_valid_elements: 'script[src|async|defer|type|charset]', images_upload_url: 'process/upload.php', file_picker_callback: function(callback, value, meta) { var input = document.createElement('input'); input.setAttribute('type', 'file'); input.setAttribute('accept', 'image/*'); input.onchange = function() { var file = this.files[0]; var reader = new FileReader(); reader.onload = function() { var id = 'blob' + (new Date()).getTime(); var blobCache = tinymce.activeEditor.editorUpload.blobCache; var base64 = reader.result.split(',')[1]; var blobInfo = blobCache.create(id, file, base64); blobCache.add(blobInfo); callback(blobInfo.blobUri(), { title: file.name }); }; reader.readAsDataURL(file); }; input.click(); }, menubar: 'edit format', toolbar: 'undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | table | forecolor backcolor removeformat | code fullscreen preview | hr charmap image media link', plugins: 'image imagetools code preview table charmap paste media autolink link hr fullscreen lists', contextmenu: 'link image imagetools table spellchecker lists' }); } } }); $('.emailRow').magnificPopup({ type: 'ajax', closeBtnInside: true, ajax: { settings: { method: 'POST', url: 'process/get.section.collection.php' } }, callbacks: { elementParse: function(item) { postData = { act: 'emailForm', id: $(item.el[0]).data('id') } this.st.ajax.settings.data = postData; }, ajaxContentAdded: function() { tinymce.remove(); tinymce.init({ selector: 'textarea#sendBody', height: 400, statusbar: false, forced_root_block: '', force_br_newlines: true, force_p_newlines: false, file_picker_types: 'image', automatic_uploads: true, paste_data_images: true, invalid_elements: 'span', extended_valid_elements: 'script[src|async|defer|type|charset]', images_upload_url: 'process/upload.php', file_picker_callback: function(callback, value, meta) { var input = document.createElement('input'); input.setAttribute('type', 'file'); input.setAttribute('accept', 'image/*'); input.onchange = function() { var file = this.files[0]; var reader = new FileReader(); reader.onload = function() { var id = 'blob' + (new Date()).getTime(); var blobCache = tinymce.activeEditor.editorUpload.blobCache; var base64 = reader.result.split(',')[1]; var blobInfo = blobCache.create(id, file, base64); blobCache.add(blobInfo); cb(blobInfo.blobUri(), { title: file.name }); }; reader.readAsDataURL(file); }; input.click(); }, menubar: 'file edit view format', toolbar: 'undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | charmap | fullscreen preview | image media link', plugins: 'image imagetools code preview table charmap paste media autolink link', contextmenu: "link image imagetools table spellchecker lists" }); } } }); $('.restoreRow').magnificPopup({ type: 'ajax', closeBtnInside: true, ajax: { settings: { method: 'POST', url: 'process/get.section.collection.php' } }, callbacks: { elementParse: function(item) { postData = { act: 'restoreCollection', id: $(item.el[0]).data('id') } this.st.ajax.settings.data = postData; } } }); $('.archiveRow').magnificPopup({ type: 'ajax', closeBtnInside: true, ajax: { settings: { method: 'POST', url: 'process/get.section.collection.php' } }, callbacks: { elementParse: function(item) { postData = { act: 'archiveCollection', id: $(item.el[0]).data('id') } this.st.ajax.settings.data = postData; } } }); $('.delRow').magnificPopup({ type: 'ajax', closeBtnInside: true, ajax: { settings: { method: 'POST', url: 'process/get.section.collection.php' } }, callbacks: { elementParse: function(item) { postData = { act: 'delCollection', id: $(item.el[0]).data('id') } this.st.ajax.settings.data = postData; } } }); generateSM(); }); </script> <script> function sendWhatsApp() { var base_url = "http://web.whatsapp.com/send?text="; // Example values (replace with actual session values) var headline = encodeURIComponent("Your headline here"); var content = encodeURIComponent("Your content here"); // Concatenate the headline and content to the base URL var link = base_url + headline + encodeURIComponent("\n\n") + content; // Log the generated WhatsApp share link to console console.log(link); var newWindow = window.open(link, "_blank"); if (!newWindow || newWindow.closed || typeof newWindow.closed == 'undefined') { // Popup blocked or not opened alert("Popup blocked! Please allow popups for this site."); } // // Open the WhatsApp share link in a new tab or window // window.open(link, "_blank"); } console.log("Hello") </script> </body> </html>