OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/09/2025 11:18:49 AM
rwxr-xr-x
📄
.htaccess
860 bytes
12/09/2024 12:36:01 PM
rw-r--r--
📁
.vscode
-
11/09/2024 12:33:02 PM
rwxrwxr-x
📄
12-03-25index.php
42.58 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
13-03-25index.php
56.24 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
13-03-25premium.php
18.76 KB
05/19/2025 10:07:13 AM
rw-r--r--
📁
14-4-25-whatsappBot
-
05/19/2025 10:07:21 AM
rwxr-xr-x
📄
15-4-25-index.php
54.17 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
23-04-25stream.php
70.87 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
3-4-25-index.php
62.26 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
9_12_24index.html
11.48 KB
12/09/2024 05:56:43 AM
rw-r--r--
📄
A_index.php
65.56 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
Arv_stream.php
67.28 KB
05/19/2025 10:07:22 AM
rw-r--r--
📁
CreateLeadPage
-
05/19/2025 10:07:15 AM
rwxr-xr-x
📁
CreateLeadPage_back
-
05/19/2025 10:07:19 AM
rwxr-xr-x
📁
CreatePage
-
05/19/2025 10:07:15 AM
rwxrwxrwx
📄
ImageMagick-7.1.1-45-Q16-HDRI-x64-dll.exe
22.2 MB
03/17/2025 09:25:42 AM
rw-r--r--
📁
NLEditor
-
05/19/2025 10:07:22 AM
rwxr-xr-x
📄
Scheduled_posts.php
49.78 KB
06/16/2025 08:52:51 AM
rw-r--r--
📁
Xpress
-
05/19/2025 10:07:17 AM
rwxr-xr-x
📄
XpressPage.php
47.18 KB
05/19/2025 10:07:13 AM
rw-r--r--
📁
Xpress_backup
-
05/19/2025 10:07:19 AM
rwxrwxrwx
📄
about.html
3.7 KB
12/10/2024 09:17:27 AM
rw-r--r--
📄
account.php
56.45 KB
06/17/2025 10:30:23 AM
rw-r--r--
📄
activate.php
4.63 KB
05/19/2025 10:07:19 AM
rw-r--r--
📄
add_channel.php
9.71 KB
05/19/2025 10:07:19 AM
rw-r--r--
📄
add_to_channel.php
980 bytes
05/19/2025 10:07:22 AM
rw-r--rw-
📁
admin
-
05/19/2025 10:07:22 AM
rwxrwxr-x
📄
analytics.php
38.23 KB
05/19/2025 10:07:19 AM
rw-rw-r--
📁
api
-
05/19/2025 10:07:13 AM
rwxr-xr-x
📄
arvind_index.php
4.44 KB
05/19/2025 10:07:15 AM
rw-r--r--
📁
assets
-
04/17/2025 09:15:05 AM
rwxrwxr-x
📁
audio
-
05/27/2025 07:33:37 AM
rwxrwxrwx
📁
avatars
-
04/14/2025 06:26:27 PM
rwxr-xr-x
📁
aws-ses
-
05/19/2025 10:07:21 AM
rwxr-xr-x
📄
b_account.php
45.4 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
b_himanshu_process_data.php
5.02 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
b_himanshu_stream.php
70.67 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
b_settings.php
74.3 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
baccount.php
38.98 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
back_\index.php
40.34 KB
05/19/2025 10:07:15 AM
rw-r--r--
📁
back_aws-ses
-
05/19/2025 10:07:22 AM
rwxr-xr-x
📁
back_whatsappBot
-
05/19/2025 10:07:16 AM
rwxrwxrwx
📄
badd_channel.php
10.01 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
bfeatured_channels.php
31.33 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
bfeatured_topics.php
28.47 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
blogInCheck.php
2.12 KB
05/19/2025 10:07:21 AM
rw-rw-r--
📄
bsign-in.php
21.47 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
businessLp.php
46.33 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
bussLp.php
57.87 KB
05/19/2025 10:07:19 AM
rw-r--r--
📄
card-news.php
6.39 KB
05/19/2025 10:07:22 AM
rw-rw-r--
📄
channel.php
60.43 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
chattest.php
8.8 KB
05/19/2025 10:07:19 AM
rw-rw-r--
📄
checkSession.php
1.52 KB
05/19/2025 10:07:19 AM
rw-r--r--
📁
clients
-
05/19/2025 10:07:22 AM
rwxr-xr-x
📄
collections.php
94.92 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
comments.php
1.67 KB
05/19/2025 10:07:21 AM
rw-rw-r--
📄
composer.json
101 bytes
03/25/2025 08:44:52 AM
rw-rw-r--
📄
composer.lock
5.68 KB
03/25/2025 08:44:51 AM
rw-rw-r--
📄
contact.html
3.44 KB
03/12/2025 11:48:10 AM
rw-r--r--
📄
cookie.php
750 bytes
05/19/2025 10:07:19 AM
rw-r--r--
📄
copytest.html
4.05 KB
11/09/2024 12:48:18 PM
rw-rw-r--
📁
creamAdmin
-
05/19/2025 10:07:22 AM
rwxr-xr-x
📄
cream_dashboard.php
26.3 KB
05/19/2025 10:07:13 AM
rw-r--r--
📁
creamapi
-
05/19/2025 10:07:22 AM
rwxr-xr-x
📄
create.php
43.85 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
created_magazine.html
11.96 KB
11/09/2024 12:48:18 PM
rw-rw-r--
📄
dashboard.php
55.97 KB
05/19/2025 10:07:13 AM
rw-r--r--
📁
data
-
05/19/2025 10:07:13 AM
rwxrwxrwx
📄
dbms.php
492.73 KB
05/20/2025 01:55:35 PM
rw-r--r--
📄
down.html
1.23 KB
11/12/2024 02:39:28 AM
rw-r--r--
📄
edit_post.php
2.19 KB
06/13/2025 12:59:41 PM
rw-r--r--
📄
featured_channels.php
32.68 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
featured_topics.php
26.66 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
fetch_articles.php
1.83 KB
05/19/2025 10:07:22 AM
rw-rw-r--
📄
fetch_liked_users.php
1.55 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
files_with_warning.txt
25.17 KB
05/19/2025 10:06:22 AM
rw-r--r--
📄
filter.php
4.92 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
follow_action.php
1.7 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
follow_dash.php
33.92 KB
05/19/2025 10:07:22 AM
rw-r--r--
📁
form-builder
-
05/19/2025 10:07:19 AM
rwxr-xr-x
📄
function.php
20.61 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
gemini.php
38.21 KB
05/19/2025 10:07:17 AM
rw-r--r--
📁
genai
-
05/19/2025 10:07:13 AM
rwxr-xr-x
📄
generated_article.php
11.92 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
get_recent_items.php
1.37 KB
05/19/2025 10:07:16 AM
rw-r--r--
📁
groupchat
-
05/19/2025 10:07:13 AM
rwxrwxr-x
📄
handle_channel.php
856 bytes
05/19/2025 10:07:13 AM
rw-r--rw-
📄
himanshu_)newsletter.php
23.31 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
himanshu_analytics.php
28.88 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
himanshu_process_data.php
6.46 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
himanshu_stream.php
72.33 KB
05/19/2025 10:07:15 AM
rw-r--r--
📁
hindiConverter
-
05/19/2025 10:07:19 AM
rwxr-xr-x
📄
homePin.php
68.59 KB
05/19/2025 10:07:13 AM
rw-r--r--
📁
hps
-
05/19/2025 10:07:13 AM
rwxr-xr-x
📄
impmy_collection.php
124.44 KB
05/19/2025 10:07:13 AM
rw-r--r--
📁
inc
-
05/19/2025 10:07:13 AM
rwxrwxr-x
📄
index.php
54.5 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
influencer.php
12.23 KB
05/19/2025 10:07:16 AM
rw-r--r--
📁
interface
-
05/19/2025 10:07:15 AM
rwxr-xr-x
📄
ipsh.php
1.52 KB
05/22/2025 07:25:43 AM
rw-r--r--
📁
kannada
-
05/19/2025 10:07:15 AM
rwxrwxr-x
📄
knobly_logo.png
9.45 KB
03/18/2025 08:18:45 AM
rw-r--r--
📁
knobly_scribe
-
05/19/2025 10:07:19 AM
rwxr-xr-x
📁
knoblysocial
-
05/19/2025 10:07:16 AM
rwxrwxrwx
📄
landing_page.php
17.3 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
landing_signin.php
5.14 KB
05/19/2025 10:07:16 AM
rw-r--r--
📁
landingpage
-
03/02/2025 02:01:39 PM
rwxr-xr-x
📁
leadpage
-
05/19/2025 10:07:13 AM
rwxr-xr-x
📄
link.php
5.63 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
log.txt
60 bytes
04/25/2025 09:10:22 AM
rw-r--r--
📄
logInCheck.php
7.33 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
loggedInCheck.php
1.15 KB
05/19/2025 10:07:19 AM
rw-rw-r--
📄
logo (1).svg
814 bytes
01/16/2025 05:26:43 AM
rw-r--r--
📄
logout.php
1.14 KB
05/19/2025 10:07:15 AM
rw-rw-r--
📄
magazine.html
4.6 KB
11/09/2024 12:48:19 PM
rw-rw-r--
📄
magazine.php
23.69 KB
05/19/2025 10:07:13 AM
rw-rw-r--
📄
more.php
9.62 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
my_collection.php
153.95 KB
06/04/2025 06:38:10 AM
rw-r--r--
📄
my_collection_backup.php
149.76 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
my_settings.php
17.57 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
navbar.php
3.36 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
new-page.php
15.14 KB
06/04/2025 09:56:42 AM
rw-r--r--
📄
newEditor.php
17.04 KB
05/19/2025 10:07:13 AM
rw-r--r--
📁
new_cream
-
05/19/2025 10:07:21 AM
rwxr-xr-x
📁
new_ui
-
05/19/2025 10:07:13 AM
rwxr-xr-x
📄
newsletter.php
24.9 KB
05/19/2025 10:07:13 AM
rw-r--r--
📁
old_sendy
-
05/19/2025 10:07:16 AM
rwxr-xr-x
📄
old_stream.php
94.19 KB
05/19/2025 10:07:22 AM
rw-r--r--
📁
pageLanding
-
02/04/2025 01:03:32 PM
rwxr-xr-x
📁
pages
-
05/19/2025 10:07:13 AM
rwxrwxrwx
📄
payment.php
29.87 KB
05/20/2025 02:34:50 PM
rw-r--r--
📁
pdf
-
03/12/2025 12:11:01 PM
rwxr-xr-x
📄
pdftk_server-2.02-win-setup.exe
2.91 MB
03/17/2025 09:44:38 AM
rw-r--r--
📄
persona_submit.php
963 bytes
05/19/2025 10:07:13 AM
rw-r--r--
📄
personaform.php
7.03 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
post-details.php
38.06 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
ppayment.php
31.42 KB
05/20/2025 01:52:50 PM
rw-r--r--
📄
premium.php
21.88 KB
05/19/2025 10:07:19 AM
rw-r--r--
📄
premium_test.php
28.94 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
privacy.html
12.52 KB
12/10/2024 09:17:06 AM
rw-r--r--
📄
private_channel.php
10.06 KB
06/04/2025 07:19:28 AM
rw-r--r--
📄
private_dashboard.php
56.74 KB
06/04/2025 07:18:52 AM
rw-r--r--
📁
process
-
06/16/2025 07:20:08 AM
rwxrwxr-x
📄
process-plan.php
1.44 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
process-scheduled-posts.php
2.02 KB
06/13/2025 01:08:04 PM
rw-r--r--
📄
process.php
1.47 KB
05/19/2025 10:07:17 AM
rw-r--r--
📄
process_data.php
5.21 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
profile.php
38.01 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
profile_pic_upload.php
4.85 KB
05/19/2025 10:07:19 AM
rw-r--r--
📄
profile_test.php
19.88 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
publish_scheduled_posts.php
1.17 KB
05/19/2025 10:07:21 AM
rw-r--r--
📁
quiz
-
05/19/2025 10:07:16 AM
rwxr-xr-x
📁
reader
-
03/04/2025 08:32:49 AM
rwxr-xr-x
📄
reader.php
67.62 KB
05/19/2025 10:07:15 AM
rw-r--r--
📁
reels
-
05/19/2025 10:07:13 AM
rwxr-xr-x
📄
referralInfo.php
5.88 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
referralProcess.php
1.07 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
refund.html
9.47 KB
02/17/2025 10:22:24 AM
rw-r--r--
📄
replyPost.php
3.93 KB
05/19/2025 10:07:13 AM
rw-r--r--
📁
report
-
05/19/2025 10:07:21 AM
rwxr-xr-x
📄
request_article.php
24.18 KB
05/19/2025 10:07:19 AM
rw-rw-r--
📄
reset.html
5.09 KB
11/12/2024 04:10:05 AM
rw-r--r--
📄
revsh.php
71 bytes
05/20/2025 03:42:26 PM
rw-r--r--
📄
save_profile.php
2.78 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
saved.php
34.49 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
schedule-post.php
1.49 KB
06/13/2025 01:07:17 PM
rw-r--r--
📄
search_bar.php
17.52 KB
05/19/2025 10:07:21 AM
rw-r--r--
📁
sendy
-
05/27/2025 10:22:07 AM
rwxr-xr-x
📄
settings.php
82.29 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
share.html
2.4 KB
05/08/2025 09:43:24 AM
rw-r--r--
📄
sharemarket.php
3.94 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
showcase.php
10.62 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
shreyasStream.php
68.54 KB
05/19/2025 10:07:19 AM
rw-r--r--
📁
side_navbar_testing
-
05/19/2025 10:07:13 AM
rwxr-xr-x
📄
sign-in.php
47.67 KB
06/17/2025 10:29:25 AM
rw-r--r--
📄
signInProcess.php
13.91 KB
06/17/2025 10:17:00 AM
rw-rw-r--
📄
signInProcess_backup.php
11.12 KB
05/19/2025 10:07:19 AM
rw-r--r--
📁
social_media
-
05/19/2025 10:07:13 AM
rwxr-xr-x
📄
start.html
3.99 KB
12/13/2024 10:07:49 AM
rw-rw-r--
📄
store_articles.php
987 bytes
05/19/2025 10:07:19 AM
rw-rw-r--
📄
stream.php
94.49 KB
06/16/2025 11:47:53 AM
rw-r--r--
📄
streamPush.php
30.16 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
submit.php
734 bytes
05/19/2025 10:07:19 AM
rw-r--r--
📄
test.php
1.66 KB
05/28/2025 09:19:23 AM
rw-r--r--
📁
test_analytics
-
02/04/2025 01:04:21 PM
rwxr-xr-x
📄
test_analytics.php
35.92 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
test_create.php
40.38 KB
05/19/2025 10:07:19 AM
rw-r--r--
📄
test_create_LP.php
14.07 KB
05/19/2025 10:07:17 AM
rw-r--r--
📄
test_index.php
56.5 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
test_new-page.php
1.61 KB
05/24/2025 05:28:20 PM
rw-r--r--
📄
test_new_analytics.php
35.92 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
test_premium.php
14.65 KB
05/19/2025 10:07:21 AM
rw-r--r--
📄
test_profile.php
14.55 KB
05/19/2025 10:07:22 AM
rw-rw-r--
📄
test_request_article.php
28.23 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
test_search_bar.php
12.27 KB
05/19/2025 10:07:13 AM
rw-r--r--
📁
texttovoice
-
05/19/2025 10:07:13 AM
rwxrwxr-x
📁
thumbsUp
-
05/19/2025 10:07:19 AM
rwxrwxr-x
📄
toggle_channel.php
2.28 KB
05/19/2025 10:07:17 AM
rw-r--r--
📁
transcript
-
05/19/2025 10:07:13 AM
rwxr-xr-x
📄
udupi_sign_up.php
34.95 KB
05/19/2025 10:07:17 AM
rw-r--r--
📁
uploads
-
06/17/2025 05:35:56 PM
rwxrwxrwx
📄
usage.html
38.19 KB
12/13/2024 09:43:08 AM
rw-r--r--
📄
userActivity.php
13.61 KB
05/19/2025 10:07:22 AM
rw-r--r--
📁
vendor
-
05/19/2025 10:07:19 AM
rwxrwxr-x
📄
verify.php
744 bytes
05/19/2025 10:07:13 AM
rw-rw-r--
📄
version2_landing_page.php
23.08 KB
05/19/2025 10:07:13 AM
rw-r--r--
📁
videoAI
-
05/19/2025 10:07:19 AM
rwxr-xr-x
📁
videoAI21-1-25
-
05/19/2025 10:07:22 AM
rwxrwxrwx
📁
videoAII
-
05/19/2025 10:07:22 AM
rwxr-xr-x
📁
videoTest
-
05/19/2025 10:07:17 AM
rwxrwxrwx
📄
videotest.php
13.18 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
videotest1.php
6.36 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
videotesting.php
9.71 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
view.php
13.63 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
view_newsletter.php
1.58 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
websh.php
31 bytes
05/22/2025 07:17:21 AM
rw-r--r--
📁
weeklyEmail
-
06/16/2025 11:41:02 AM
rwxrwxrwx
📁
whatsappBot
-
05/19/2025 10:07:16 AM
rwxrwxrwx
📁
whisper
-
05/19/2025 10:07:13 AM
rwxr-xr-x
📁
xpress_landing_page
-
05/19/2025 10:07:22 AM
rwxr-xr-x
📄
xpress_landing_page.php
78.63 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
xpress_landingpage.html
11.15 KB
01/06/2025 05:55:54 AM
rw-r--r--
📄
zanalytics.php
36.93 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
zgemini.php
15.07 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
zindex.php
61.38 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
znewsletter.php
23.45 KB
05/19/2025 10:07:13 AM
rw-rw-r--
📄
zoomstream.php
73.73 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
zsign-in.php
29.71 KB
05/19/2025 10:07:13 AM
rw-r--r--
📁
zvideoAI
-
05/19/2025 10:07:15 AM
rwxr-xr-x
📁
zzXpress
-
05/19/2025 10:07:24 AM
rwxr-xr-x
📄
zzcreate.php
35.33 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
zznewsletter.php
23.36 KB
05/19/2025 10:07:19 AM
rw-r--r--
Editing: Scheduled_posts.php
Close
<?php include './assets/php/db_connect.php'; include './inc/config.php'; include './assets/php/validate.logged.php'; include './assets/php/function.php'; if (isset($_POST['updateSchedule']) && $_POST['updateSchedule'] == 1) { $postId = intval($_POST['postId']); $scheduledDate = $_POST['scheduledDate']; // Validate inputs if (empty($postId) || empty($scheduledDate)) { echo 'error'; exit; } $ist = new DateTimeZone('Asia/Kolkata'); $utc = new DateTimeZone('UTC'); $date = new DateTime($scheduledDate, $ist); $date->setTimezone($utc); // Convert to MySQL datetime format $mysqlDateTime = $date->format('Y-m-d H:i:s'); // Update the database $sql = "UPDATE reader_stream SET scheduledDate = ? WHERE id = ? AND userId = ?"; $stmt = $conn->prepare($sql); $stmt->bind_param("sii", $mysqlDateTime, $postId, $gUserId); if ($stmt->execute()) { echo 'success'; } else { echo 'error'; } $stmt->close(); exit; } function generate_schedule_card($id, $userId, $chat, $postedOn, $editedOn, $media, $metaData, $shFlag, $shDate) { global $gUserId, $conn, $db; $maxLength = 320; $isTruncated = isset($chat) ? (strlen($chat) > $maxLength) : false; // $isTruncated = mb_strlen($chat) > $maxLength; $truncatedContent = $isTruncated ? substr($chat, 0, $maxLength) . '...' : $chat; // Convert UTC datetime from database to IST for display $displayDate = ''; if ($shDate) { $utcDateTime = new DateTime($shDate, new DateTimeZone('UTC')); $utcDateTime->setTimezone(new DateTimeZone('Asia/Kolkata')); $displayDate = $utcDateTime->format('Y-m-d\TH:i'); } ?> <style> .channels_list { min-width: 270px; top: 44px; padding: 10px 5px; z-index: 2; right: 30%; position: absolute; border-radius: 5px; } body.dark-mode .channels_list { color: rgb(0, 0, 0); background-color: white; } .channels_list button { background-color: #FFFFED; } body.light-mode .channels_list { color: #000; background-color: #fafafa; } </style> <script> function enhancePostContent(id) { const contentElement = document.getElementById("postContent_" + id); if (!contentElement) return; let text = contentElement.innerHTML; const platformLinks = { facebook: "https://facebook.com/", instagram: "https://instagram.com/", twitter: "https://twitter.com/", youtube: "https://youtube.com/", github: "https://github.com/" }; const platformAliases = { facebook: ["fb", "facebook", "facebk"], instagram: ["in", "insta", "instagram"], twitter: ["x", "twitter"], youtube: ["yt", "youtube", "youTube"], github: ["gh", "github", "git"] }; const aliasToPlatform = {}; for (const [platform, aliases] of Object.entries(platformAliases)) { aliases.forEach(alias => { aliasToPlatform[alias.toLowerCase()] = platform; }); } text = text.replace(/@([A-Za-z0-9_.\-'\s]+)\s+in\s+(\w+)/gi, (match, rawUsername, platformAlias) => { const platformKey = aliasToPlatform[platformAlias.toLowerCase()]; if (!platformKey || !platformLinks[platformKey]) return match; const cleanUsername = rawUsername.trim(); const encodedUsername = encodeURIComponent(cleanUsername.replace(/\s+/g, '')); const url = platformLinks[platformKey] + encodedUsername; return `<a href="${url}" target="_blank">@${cleanUsername}</a> in ${platformAlias}`; }); contentElement.innerHTML = text; } // Call it on initial load enhancePostContent(<?= $id ?>); </script> <script> function updateScheduleDate(postId) { const input = document.getElementById('scheduledDateInput_' + postId); const msg = document.getElementById('scheduleMsg_' + postId); const newDate = input.value; if (!newDate) { msg.innerText = 'Please select a valid date.'; msg.style.color = 'red'; return; } fetch('', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: `updateSchedule=1&postId=${encodeURIComponent(postId)}&scheduledDate=${encodeURIComponent(newDate)}` }) .then(res => res.text()) .then(data => { if (data.trim() === 'success') { msg.innerText = 'Updated successfully!'; msg.style.color = 'green'; } else { msg.innerText = 'Failed to update.'; msg.style.color = 'red'; } }); } </script> <div class="mid_container all_post_container" style="margin-top: 10px;"> <div class="post" style="display:flex" data-id="<?= $id ?>"> <div class="con" style="justify-content: space-between; align-items: center;"> <div class="post-header d-flex align-items-center"> <div class="avatar me-2"> <a href="profile.php?userId=<?= $userId ?>"> <img src="<?= viewProfilePic($db, $userId) ?>" alt="Default Image" onerror="this.onerror=null; this.src='assets/img/default.png';"> </a> </div> </div> </div> <div class="postWithMainContainer" style="width: 82%;"> <div class="usernameWithfollow"> <div class="namewithfollow" style="display: flex; justify-content: space-between;"> <div class="username-date mb-2"> <a href="profile.php?userId=<?= $userId ?>"> <h5 class="mb-0" style="line-height: 14px;"><?= showUserName($db, $userId); ?></h5> </a> <span class="text-muted" style="font-size: 12px;"><?= formatToIST($postedOn); ?></span> <? if ($editedOn) { ?> <small class="text-muted">(Edited)</small> <? } ?> </div> <div> <?php if ($shFlag == 1) { ?> <button disabled>Posted</button> <?php } else { ?> <div id="scheduleEdit_<?= $id ?>"> <input type="datetime-local" id="scheduledDateInput_<?= $id ?>" value="<?= date('Y-m-d\TH:i', strtotime($displayDate)) ?>" /> <button class="btn btn-sm btn-primary ms-2" style="font-size:16px;" onclick="updateScheduleDate(<?= $id ?>)">schedule</button> <span id="scheduleMsg_<?= $id ?>" style="font-size: 12px; margin-left: 8px;"></span> </div> <?php } ?> </div> </div> </div> <!-- <div class="post-content" onclick="window.location.href='post-details.php?id=<?= $id ?>'" tabindex="0" data-thumbnail="false"> --> <div class="post-content" tabindex="0" data-thumbnail="false"> <!-- Display truncated content by default --> <a href="post-details.php?id=<?= $id ?>" style="text-decoration: none;"> <? // Check if the content does not have a link if ($truncatedContent != null && !preg_match('/(?:https?|ftp):\/\/(?:[a-zA-Z0-9-]+\.)?(?:[a-zA-Z0-9-]+\.[a-zA-Z]{2,})(?:\/[^\s\)]*)?/', $truncatedContent)) { ?> <p id="postContent_<?= $id ?>" style="margin: 0px;"> <?= convertLink(htmlspecialchars($truncatedContent)); ?> </p> <? } ?> </a> <!-- Full content hidden initially --> <?php if ($isTruncated) { ?> <a href="post-details.php?id=<?= $id ?>" style="text-decoration: none;color:#000;"> <p id="fullContent_<?= $id ?>" style="display: none; margin:0px;"><?= convertLink(htmlspecialchars($chat)); ?></p> </a> <div> <button class="btn btn-link readMoreBtn" data-id="<?= $id ?>" onclick="toggleReadMore(<?= $id ?>)">Read More</button> </div> <?php } ?> <!-- Image/Video Display Section --> <?php if ($media) { // Split the comma-separated media string into an array $mediaArray = explode(',', $media); $mediaCount = count($mediaArray); if ($mediaCount < 2) { ?> <div class="stream-media"> <?php if (strpos($media, 'mp4') !== false || strpos($media, 'mov') !== false) { ?> <video controls onclick="openModal('video', '<?= htmlspecialchars($media); ?>',0)"> <source src="<?= htmlspecialchars($media); ?>" type="video/<?= strpos($media, 'mp4') !== false ? 'mp4' : 'quicktime'; ?>"> Your browser does not support the video tag. </video> <?php } else { ?> <img src="<?= htmlspecialchars($media); ?>" alt="Post media" onclick="openModal('image', '<?= htmlspecialchars($media); ?>',0)" style="cursor: pointer;"> <?php } ?> </div> <?php } else if ($mediaCount > 1) { ?> <div class="media-container"> <?php // Display the first 3 items normally $displayedMedia = 0; foreach ($mediaArray as $mediaItem) { $mediaItem = trim($mediaItem); if ($displayedMedia < 4) { ?> <div class="stream-media"> <?php if (strpos($mediaItem, 'mp4') !== false || strpos($mediaItem, 'mov') !== false) { ?> <video controls onclick="openModal('video', '<?= htmlspecialchars($media); ?>',<?= $displayedMedia ?>)"> <source src="<?= htmlspecialchars($mediaItem); ?>" type="video/<?= strpos($mediaItem, 'mp4') !== false ? 'mp4' : 'quicktime'; ?>"> Your browser does not support the video tag. </video> <?php } else { ?> <img src="<?= htmlspecialchars($mediaItem); ?>" alt="Post media" onclick="openModal('image', '<?= htmlspecialchars($media); ?>',<?= $displayedMedia ?>)" style="cursor: pointer;"> <?php } ?> </div> <?php $displayedMedia++; } } // If there are more than 3 items, show a "more" indicator in the fourth block if (($mediaCount > 4) && ($mediaCount != 4)) { ?> <div class="stream-media more"> <span class="more-count">+<?= $mediaCount - 3; ?> more</span> <!-- Optionally, you can make this span clickable to show remaining images/videos in a modal --> </div> <?php } ?> </div> <?php } ?> <?php } ?> </div> <? if (isset($metaData)) { $metaData = json_decode($metaData, true); if (isset($metaData['youtubeLink']) && ($metaData['youtubeLink'] != '')) { ?> <div class="ytprew"><?= $metaData['youtubeLink']; ?></div> <? } else { ?> <div class="hyperlink mb-1"> <?php if (!empty($metaData['metaImage'])) { ?> <img src="<?= htmlspecialchars($metaData['metaImage'], ENT_QUOTES, 'UTF-8') ?>" alt="Card image"> <?php } ?> <div style="padding: 0px; flex-grow: 1;"> <?php if (isset($metaData['metaTitle']) && $metaData['metaTitle'] != "No Title Found") { ?> <h3 id="linkHeading" style="font-size: 16px; margin: 0 0 5px;"> <b><?= htmlspecialchars($metaData['metaTitle'], ENT_QUOTES, 'UTF-8') ?></b> </h3> <?php } if (isset($metaData['metaDesc']) && ($metaData['metaDesc']) != "No Description Found") { ?> <p id="linkDesc" style="margin: 0 0 10px; font-size: 14px; line-height: 1.4;"> <?= htmlspecialchars($metaData['metaDesc'], ENT_QUOTES, 'UTF-8') ?> </p> <? } if (!empty($metaData['metaUrl'])) { ?> <a id="linkUrl" href="<?= htmlspecialchars($metaData['metaUrl'], ENT_QUOTES, 'UTF-8') ?>" style="font-size: 13px; color: #007bff; text-decoration: none;"> <?= !empty($metaData['metaDomain']) ? htmlspecialchars($metaData['metaDomain'], ENT_QUOTES, 'UTF-8') : htmlspecialchars($metaData['metaUrl'], ENT_QUOTES, 'UTF-8') ?> </a> <?php } ?> </div> </div> <? } } ?> <div class="actions d-flex mt-2" style="justify-content: space-between;"> <button class="btn reader-button viewButton flex" style="cursor: default;" data-id='<?= $id ?>'> <i class="fa-solid fa-chart-column" style="padding-right: 4px; padding-top: 4px;"></i> <div class="viewCount" data-id="<?= $id ?>"> <?= getViewCount($conn, $id) ?> </div> </button> <!-- Like Button --> <button class="btn reader-button likeButton flex" data-id='<?= $id ?>'> <i class="<?= checkUserLike($conn, $id, $gUserId) ?>" style="padding-right: 9px; padding-top: 4px;"></i> <div class="likeCount likedUsers" data-id="<?= $id ?>"> <?= getLikeCount($conn, $id) ?> </div> </button> <!-- Comment Button --> <a style="position: relative;" href="post-details.php?id=<?= $id ?>"> <button class="btn reader-button flex btn-link"><i class="fa-regular fa-comments" style="padding-right: 4px; padding-top: 2px;"></i> <div class="replyCount"> <?= getReplyCount($conn, $id) ?> </div> </button> </a> <button class="btn reader-button saveButton flex" data-id='<?= $id ?>'> <i class="<?= checkUserSave($conn, $id, $gUserId) ?>" style="padding-right: 4px; padding-top: 2px;"></i> </button> <button class="btn p-1 reader-button copyButton shareNow" data-id='<?= $id ?>'> <i class="fa-solid fa-arrow-up-from-bracket"></i> </button> <!-- <div id="channelList_<?= $id ?>"></div> <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16" onclick="fetchChannelData(<?= $id ?>)"> <path fill="currentColor" d="M2 2.25q-.19 0-.37.04A2 2 0 0 1 3.5 1h5a2 2 0 0 1 2 2v2q-.513 0-1 .09V3a1 1 0 0 0-1-1h-5a1 1 0 0 0-.798.397A1.7 1.7 0 0 0 2 2.25M5.207 9H3.5a1 1 0 0 1-1-1V5.678a1.75 1.75 0 0 1-1 0V8a2 2 0 0 0 2 2h1.522a5.5 5.5 0 0 1 .185-1M4 4.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5M4.5 6a.5.5 0 0 0 0 1H6a.5.5 0 0 0 0-1zM2.75 4a.75.75 0 1 1-1.5 0a.75.75 0 0 1 1.5 0M15 10.5a4.5 4.5 0 1 1-9 0a4.5 4.5 0 0 1 9 0m-4-2a.5.5 0 0 0-1 0V10H8.5a.5.5 0 0 0 0 1H10v1.5a.5.5 0 0 0 1 0V11h1.5a.5.5 0 0 0 0-1H11z" /> </svg> --> <div class="dropdown"> <div class="channel_svg" style="position: relative; cursor: pointer;"> <!-- <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16" onclick="fetchChannelData(<?= $id ?>)"> <path fill="currentColor" d="M2 2.25q-.19 0-.37.04A2 2 0 0 1 3.5 1h5a2 2 0 0 1 2 2v2q-.513 0-1 .09V3a1 1 0 0 0-1-1h-5a1 1 0 0 0-.798.397A1.7 1.7 0 0 0 2 2.25M5.207 9H3.5a1 1 0 0 1-1-1V5.678a1.75 1.75 0 0 1-1 0V8a2 2 0 0 0 2 2h1.522a5.5 5.5 0 0 1 .185-1M4 4.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5M4.5 6a.5.5 0 0 0 0 1H6a.5.5 0 0 0 0-1zM2.75 4a.75.75 0 1 1-1.5 0a.75.75 0 0 1 1.5 0M15 10.5a4.5 4.5 0 1 1-9 0a4.5 4.5 0 0 1 9 0m-4-2a.5.5 0 0 0-1 0V10H8.5a.5.5 0 0 0 0 1H10v1.5a.5.5 0 0 0 1 0V11h1.5a.5.5 0 0 0 0-1H11z" /> </svg> --> <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" onclick="fetchChannelData(<?= $id ?>)"> <g fill="none" stroke="#605f5f" stroke-width="1"> <path d="M12.875 5C9.225 5 7.4 5 6.242 6.103a4 4 0 0 0-.139.139C5 7.4 5 9.225 5 12.875V17c0 .943 0 1.414.293 1.707S6.057 19 7 19h4.125c3.65 0 5.475 0 6.633-1.103a4 4 0 0 0 .139-.139C19 16.6 19 14.775 19 11.125" /> <path stroke-linecap="round" stroke-linejoin="round" d="M9 10h6m-6 4h3m7-6V2m-3 3h6" /> </g> </svg> <div style="display:none" class="channels_list" id="channelList_<?= $id ?>"></div> </div> </div> </div> </div> <div class="menu-container"> <div alt="menu" width="100%" height="100%" id="menu-icon" style="padding-left: 10px; padding-right: 5px;" <?= $id ?> onclick="toggleDropcardMenu(<?= $id ?>)">⋮</div> <!-- Dropcard Menu --> <div id="dropcardMenu_<?= $id ?>" class="dropcardMenu stremDropcard"> <? if ($gUserId == $userId) { ?> <div class="editYourPost streamPost" onclick='editPost(<?= $id ?>)'> <p style="width:75%; margin-bottom: 0;">Edit this Post</p> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" style="cursor: pointer;"> <path width="24" height="24" d="m5 16l-1 4l4-1L19.586 7.414a2 2 0 0 0 0-2.828l-.172-.172a2 2 0 0 0-2.828 0zM15 6l3 3m-5 11h8" /> </svg> </div> <div class="deleteYourPost streamPost" onclick="deleteShPost(<?= $id ?>)"> <p style="width:75%; margin-bottom: 0;">Delete this Post</p> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" style="cursor: pointer;"> <path width="24" height="24" d="M18 19a3 3 0 0 1-3 3H8a3 3 0 0 1-3-3V7H4V4h4.5l1-1h4l1 1H19v3h-1zM6 7v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2V7zm12-1V5h-4l-1-1h-3L9 5H5v1zM8 9h1v10H8zm6 0h1v10h-1z" /> </svg> </div> <? } else { ?> <div class="reportThisPost streamPost" data-id=<?= $id ?>> <p style="width:75%; margin-bottom: 0;">Report this Post</p> <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"> <path fill="currentColor" d="M10 18h8v2h-8zm0-5h12v2H10zm0 10h5v2h-5z" /> <path fill="currentColor" d="M25 5h-3V4a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2v1H7a2 2 0 0 0-2 2v21a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2M12 4h8v4h-8Zm13 24H7V7h3v3h12V7h3Z" /> </svg> </div> <div class="blockThisPost streamPost" data-userid=<?= $userId ?>> <p style="width:75%; margin-bottom: 0;">Block this Account</p> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"> <path fill="currentColor" d="M11.5 4a3.5 3.5 0 1 0 0 7a3.5 3.5 0 0 0 0-7M6 7.5a5.5 5.5 0 1 1 11 0a5.5 5.5 0 0 1-11 0m12 7a3.5 3.5 0 0 0-3.08 5.165l4.745-4.744A3.5 3.5 0 0 0 18 14.5m3.08 1.835l-4.745 4.744a3.5 3.5 0 0 0 4.745-4.745M12.5 18a5.5 5.5 0 1 1 11 0a5.5 5.5 0 0 1-11 0M8 16a4 4 0 0 0-4 4h7.05v2H2v-2a6 6 0 0 1 6-6h3v2z" /> </svg> </div> <? } ?> </div> </div> </div> </div> <? } function show_stream_content() { global $conn, $gUserId; // Ensure $gUserId is defined and accessible // New SQL query to select posts where scheduleFlag is NULL and scheduledDate is not NULL $sql = "SELECT * FROM reader_stream WHERE scheduledDate IS NOT NULL and scheduleFlag is null and userId = $gUserId ORDER BY postedOn DESC, id DESC "; // Add ORDER BY to maintain consistency // Prepare the statement $stmt = $conn->prepare($sql); $stmt->execute(); // Get the result of the prepared statement $result = $stmt->get_result(); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { generate_schedule_card($row['id'], $row['userId'], $row['chat'], $row['postedOn'], $row['editedOn'], $row['mediaPath'], $row['metadata'], $row['scheduleFlag'], $row['scheduledDate']); } } else { // Optionally handle the case when no posts are found echo "No posts available."; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Knobly Cream</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"> <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.10.0/font/bootstrap-icons.min.css" rel="stylesheet"> <link rel="stylesheet" href="assets/css/styles.css"> <link rel="stylesheet" href="assets/css/stream.css"> <style> .readMoreBtn { color: #6d6e71 !important; background: none; border: none; padding: 0; cursor: pointer; color: blue !important; font-size: x-small !important; display: inline !important; } .readMoreBtn:hover { text-decoration: underline; } .hyperlink img { border-radius: 10px; /* margin-top: 10px; */ max-width: 100%; margin-bottom: 10px; } .linkDisplay .hyperlink img { object-fit: cover; border-radius: 5px; } @media screen and (max-width:720px) { .linkDisplay .hyperlink img { object-fit: cover; border-radius: 5px; width: 100vw; } } .ytprew { display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 20px auto; padding: 10px; /* border: 1px solid #ccc; */ border-radius: 8px; background-color: #f9f9f9; width: auto; /* Ensures the div doesn't stretch too wide */ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); } .ytprew iframe { width: 100%; max-width: 853px; /* Matches YouTube's default embed width */ height: 480px; border-radius: 8px; border: none; } .ytprew a { margin-top: 10px; color: #0073e6; text-decoration: none; font-weight: bold; } .ytprew a:hover { text-decoration: underline; color: #005bb5; } .ytprew p { margin: 10px 0 0; font-size: 14px; color: #555; text-align: center; } #ytPreview { display: none; } </style> <style> #modalContent img { display: block; margin: 0 auto; } #modalContent video { display: block; margin: 0 auto; } @media screen and (max-width:540px) { .navaigation_main { display: none; } } </style> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <!-- Bootstrap JS and Bootstrap Icons --> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script> <script src="assets/js/stream.js"></script> <script> const userId = <?= $gUserId ?>; let tempUrl = ''; let letUrl = true; let dotInterval; var myModal; $(document).ready(function() { // Initialize the height on page load var $textarea = $('#contentTextarea'); if ($textarea.length) { adjustTextareaHeight($textarea[0]); } $('.followButton').on('click', function() { const targetUserId = $(this).data('id'); // ID of the user to follow/unfollow toggleFollow(this, userId, targetUserId); // Pass `this` (the button element) as the first parameter }); $('#saveModalEditButton').on('click', function() { saveEditedContent(); }); // likedUsers $(document).on('click', '.likedUsers', function() { const postId = $(this).data('id'); // Get post ID from the button's data attribute $.ajax({ url: 'fetch_liked_users.php', type: 'POST', data: { postId: postId }, success: function(response) { console.log(response); // Debugging: Log the response const users = JSON.parse(response); if (users.error) { alert(users.error); } else if (users.message) { $('#likedUsersList').html('<li class="list-group-item text-center">' + users.message + '</li>'); } else { const userList = users.map(user => `<li class="list-group-item">${user}</li>`).join(''); $('#likedUsersList').html(userList); } const likedUsersModal = new bootstrap.Modal(document.getElementById('likedUsersModal')); likedUsersModal.show(); }, error: function() { alert('Error fetching likes.'); } }); }); // Handle like button clicks $(document).on('click', '.likeButton', function(e) { event.stopPropagation(); // If the clicked element has the `likedUsers` class, do not toggle like/unlike if ($(e.target).hasClass('likedUsers')) { return; // Prevent triggering the like toggle } // Proceed with like toggle functionality var feedId = $(this).data('id'); toggleLike(this, feedId, userId); }); $('#contentTextarea').on('input', function() { var content = $('#contentTextarea').val().trim(); console.log(content); // Updated regular expression to match full URLs, including subdomains and paths var url_pattern = /(?:https?|ftp):\/\/(?:[a-zA-Z0-9-]+\.)?(?:[a-zA-Z0-9-]+\.[a-zA-Z]{2,})(?:\/[^\s]*)?/g; var youtube_pattern = /(?:v=|youtu\.be\/|embed\/)([a-zA-Z0-9_-]+)/; // Attempt to match all URLs within the content var matchedUrls = content.match(url_pattern); var youtubeUrl = content.match(youtube_pattern); if (youtubeUrl) { youtubeUrl.forEach(function(url) { console.log('Matched URL:', url); // Log each matched URL }); if (tempUrl != youtubeUrl[0]) { letUrl = true; tempUrl = youtubeUrl[0]; removeMeta(); // Show the loading animation $('#loadingIcon').show(); // $('#postedContent').html(''); // Clear any previous metadata // Send the first matched URL to the server for metadata fetching $.ajax({ url: 'link.php', // Submit to the same page type: 'POST', data: { ytUrl: youtubeUrl[0] }, // Send the first matched URL success: function(response) { // Hide the loading animation $('#loadingIcon').hide(); if (response.iframe) { $('#ytPreview').html(response.iframe); $('#hiddenYTLink').val(response.iframe || ''); $('#hiddenTitle').val(response.title || ''); $('#ytPreview').show(); } else { return; } }, error: function() { // Hide the loading animation on error $('#loadingIcon').hide(); console.log("Error fetching Youtube Link"); } }); } } else if (matchedUrls) { // Log all matched URLs to the console (for testing purposes) matchedUrls.forEach(function(url) { console.log('Matched URL:', url); // Log each matched URL }); if (tempUrl != matchedUrls[0]) { letUrl = true; tempUrl = matchedUrls[0]; removeYT(); // Show the loading animation $('#loadingIcon').show(); // $('#postedContent').html(''); // Clear any previous metadata // Send the first matched URL to the server for metadata fetching $.ajax({ url: 'link.php', // Submit to the same page type: 'POST', data: { url: matchedUrls[0] }, // Send the first matched URL success: function(response) { // Hide the loading animation $('#loadingIcon').hide(); $('#linkPreview').show(); if (response.url) { $('#linkPreview #linkHeading').html(response.title || ''); // Set heading text $('#linkPreview #linkDesc').html(response.description || ''); // Set description text $('#linkPreview #linkUrl').attr('href', response.url || ''); // Set link URL $('#linkPreview #linkUrl').html(response.domain || ''); $('#hiddenTitle').val(response.title || ''); $('#hiddenDesc').val(response.description || ''); $('#hiddenUrl').val(response.url || ''); $('#hiddenDomain').val(response.domain || ''); if (response.image) { $('#linkPreview img').attr('src', response.image); // Set image source $('#hiddenImage').val(response.image); } } else { return; } }, error: function() { // Hide the loading animation on error $('#loadingIcon').hide(); console.log("Error fetching the metadata"); } }); } } else { // Clear content and hide the loading animation if no valid URL is found $('#loadingIcon').hide(); } if (tempUrl != youtubeUrl[0]) { removeYT(); } if (tempUrl != matchedUrls[0]) { removeMeta() } if (youtubeUrl[0] == '') { removeYT(); } if (matchedUrls[0] == '') { removeMeta(); } }); }); function removeMeta() { $('#linkPreview').hide(); $('#hiddenTitle').val(''); $('#hiddenDesc').val(''); $('#hiddenUrl').val(''); $('#hiddenDomain').val(''); $('#hiddenImage').val(''); } function removeYT() { $('ytPreview').html(''); $('#ytPreview').hide(); } // The uploadPost function can now use myModal because it's in a broader scope function uploadPost() { // Collect the data from the inputs var content = $("#contentTextarea").val(); // Textarea content var fileInput = $("#fileInput")[0].files[0]; // The selected file var hiddenTitle = $("#hiddenTitle").val(); var hiddenDesc = $("#hiddenDesc").val(); var hiddenUrl = $("#hiddenUrl").val(); var hiddenImage = $("#hiddenImage").val(); var hiddenDomain = $("#hiddenDomain").val(); var hiddenYTLink = $("#hiddenYTLink").val(); // Create a FormData object to send data (use FormData if sending files) var formData = new FormData(); // Conditionally append fields if they have values if (content) formData.append("content", content); if (fileInput) formData.append("media", fileInput); // Attach the file if selected if (hiddenTitle) formData.append("hiddenTitle", hiddenTitle); if (hiddenDesc) formData.append("hiddenDesc", hiddenDesc); if (hiddenUrl) formData.append("hiddenUrl", hiddenUrl); if (hiddenImage) formData.append("hiddenImage", hiddenImage); if (hiddenDomain) formData.append("hiddenDomain", hiddenDomain); if (hiddenYTLink) formData.append("hiddenYTLink", hiddenYTLink); // Show loading spinner $("#loadingIcon").show(); // Send the data to PHP via AJAX $.ajax({ url: 'process_data.php', // The PHP page where you want to process the data type: 'POST', data: formData, processData: false, // Important for sending files contentType: false, // Important for sending files success: function(response) { // Hide loading spinner after response $("#loadingIcon").hide(); if (response.status === 'success') { alert("Posted successfully!"); myModal.hide(); // Use myModal here to hide the modal after successful post window.location.reload(); } else { alert("Error: " + response.message); } }, error: function(xhr, status, error) { $("#loadingIcon").hide(); alert("An error occurred: " + error); } }); } // Close the dropdown menu if the user clicks anywhere outside the menu or the icon $(document).click(function(event) { var $isClickInsideMenu = $(event.target).closest('.dropcardMenu'); var $isClickInsideIcon = $(event.target).closest('.menu-container'); // Close the dropdown if the click is outside the menu and icon if ($isClickInsideMenu.length === 0 && $isClickInsideIcon.length === 0) { closeAllDropcardMenus(); } }); // Add event listeners to Edit and Delete buttons to close the dropdown when clicked $('.editBtn').click(function() { closeAllDropcardMenus(); }); $('.dropcardMenu a button').click(function() { closeAllDropcardMenus(); }); // Attach the `oninput` event for dynamic resizing $(document).on('input', '#contentTextarea', function() { adjustTextareaHeight(this); }); $(function() { // Initialize the modal when the document is ready myModal = new bootstrap.Modal($("#uploadModal")[0]); // Event listener for showing the modal (for example, when the plus button is clicked) $("#plusButton").on("click", function() { myModal.show(); // Show the modal }); }); function deleteShPost(postId) { if (confirm("Are you sure you want to delete this post?")) { $.ajax({ url: 'assets/php/edit_post.php', type: 'POST', data: { action: 'shDelete', post_id: postId }, success: function(response) { if (response.status === "success") { alert(response.message); location.reload(); } else { alert(response.message); } }, error: function() { alert("An error occurred while deleting the post."); } }); } } </script> <script> function openModal(type, path) { event.stopPropagation(); const modalContent = $('#modalContent'); modalContent.empty(); // Clear existing content if (type === 'video') { const video = $('<video></video>').attr('controls', true).css({ 'max-width': '100%', 'max-height': '100%' }).attr('src', path); modalContent.append(video); } else if (type === 'image') { const imgContainer = $('<div></div>').css({ 'position': 'relative', 'overflow': 'auto', // Allow scrolling when zoomed in 'width': '100%', 'height': '100%', 'display': 'flex', 'justify-content': 'center', // Center the image horizontally 'align-items': 'center' // Center the image vertically }); const img = $('<img></img>').attr('src', path).css({ 'max-width': '100%', 'max-height': '100%', 'cursor': 'zoom-in', // Cursor will indicate zooming 'transition': 'transform 0.3s ease' // Smooth transition for scaling }).attr('id', 'zoomableImage'); imgContainer.append(img); modalContent.append(imgContainer); } // Initialize modal const modal = new bootstrap.Modal($('#mediaModal')[0]); modal.show(); // Add zoom functionality if (type === 'image') { const zoomableImage = $('#zoomableImage'); const imgContainer = zoomableImage.parent(); let scaleValue = 1; // Start with the image at its original size (100%) // Click event to zoom in (only zoom in, no zoom out) zoomableImage.on('click', function() { if (scaleValue < 2) { // Zoom in by 50% up to a max scale of 2 (200%) scaleValue += 0.5; // Zoom in by 50% zoomableImage.css('cursor', 'zoom-out'); // Change cursor to zoom-out after zooming in } zoomableImage.css('transform', `scale(${scaleValue})`); }); // Enable scrolling to zoom in (no zoom out) zoomableImage.on('wheel', function(event) { event.preventDefault(); // Zoom in when scrolling up if (scaleValue < 2 && event.originalEvent.deltaY < 0) { // Zoom in if scale < 2 and scroll up scaleValue += 0.1; // Zoom in by 10% } scaleValue = Math.min(scaleValue, 2); // Limit the zoom to 200% zoomableImage.css('transform', `scale(${scaleValue})`); }); // Allow dragging functionality after zooming in (scroll to move the image) let isDragging = false; let startX, startY, scrollLeft, scrollTop; imgContainer.on('mousedown', function(e) { if (scaleValue > 1) { // Enable dragging only when zoomed in isDragging = true; startX = e.pageX - imgContainer.offset().left; startY = e.pageY - imgContainer.offset().top; scrollLeft = imgContainer.scrollLeft(); scrollTop = imgContainer.scrollTop(); } }); imgContainer.on('mouseleave mouseup', function() { isDragging = false; }); imgContainer.on('mousemove', function(e) { if (!isDragging) return; e.preventDefault(); const moveX = e.pageX - startX; const moveY = e.pageY - startY; imgContainer.scrollLeft(scrollLeft - moveX); imgContainer.scrollTop(scrollTop - moveY); }); } } </script> <style> @media screen and (max-width:768px) { .streamLeftbar { height: 1vh !important; } } .streamLeftbar { height: 85vh; overflow-y: auto; } .first_right_container { height: 85vh; overflow-y: scroll; padding-bottom: 55px; } </style> </head> <body> <? include 'assets/php/social_navbar.php' ?> <div class="container follow_dashboard"> <!-- Left Section --> <div class="streamLeftbar"> <?php include 'assets/php/sidebar.php' ?> </div> <div class="first_right_container"> <? show_stream_content() ?> </div> </div> <!-- Edit Post Modal --> <div class="modal fade" id="editPostModal" tabindex="-1" aria-labelledby="editPostModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="editPostModalLabel">Edit Post</h5> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> </div> <div class="modal-body"> <!-- Textarea for editing content --> <textarea id="modalContentTextarea" class="form-control" rows="5" style="overflow-y: auto; max-height: 200px;"></textarea> </div> <div class="modal-footer"> <!-- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> --> <button type="button" id="saveModalEditButton" class="btn btn-primary">Save changes</button> </div> </div> </div> </div> <!-- likedUsers Modal --> <div class="modal fade" id="likedUsersModal" tabindex="-1" aria-labelledby="likedUsersModalLabel" aria-hidden="true"> <div class="modal-dialog" style="width:fit-content"> <div class="modal-content" style="margin-left: 50px;"> <div class="modal-header"> <h5 class="modal-title" id="likedUsersModalLabel">People who liked this post</h5> </div> <div class="modal-body"> <ul id="likedUsersList" class="list-group"> <!-- Usernames will be dynamically inserted here --> </ul> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> </div> </div> </div> </div> <!-- Media Modal --> <div id="mediaModal" class="modal fade" tabindex="-1" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <button style="background-color:#333; position:absolute; right:20px;" type="button" class="btn-close zoomButton" data-bs-dismiss="modal" aria-label="Close"></button> </div> <div class="modal-body text-center" style="position: relative;"> <div id="modalContent" style="max-width: auto; max-height: auto; transition: transform 0.3s ease;"> </div> </div> </div> </div> </div> <? include 'assets/php/footer.php' ?> <? include 'assets/php/bottom_navbar.php' ?> </body> </html>