feat: update charity project assets, add livestream media, and clean up temporary migration scripts

This commit is contained in:
2026-07-15 16:37:05 +07:00
parent f4e24a0e00
commit fd4ad87a32
168 changed files with 3596 additions and 717 deletions
Binary file not shown.
+22
View File
@@ -0,0 +1,22 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
public class CheckCat {
public static void main(String[] args) {
try {
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
PreparedStatement stmt = conn.prepareStatement("SELECT category_id FROM sis_post WHERE id = 6450");
ResultSet rs = stmt.executeQuery();
if (rs.next()) {
System.out.println("Category ID: " + rs.getLong(1));
}
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Binary file not shown.
+26
View File
@@ -0,0 +1,26 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
public class CheckCategories {
public static void main(String[] args) {
try {
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT id, name, slug FROM sis_category");
while (rs.next()) {
System.out.println(rs.getLong("id") + " - " + rs.getString("name") + " (" + rs.getString("slug") + ")");
}
System.out.println("--- POSTS ---");
rs = stmt.executeQuery("SELECT id, title, slug, category_id, status FROM sis_post WHERE ROWNUM <= 10");
while (rs.next()) {
System.out.println("Post: " + rs.getLong("id") + " - " + rs.getString("title") + " (Cat: " + rs.getLong("category_id") + ", Status: " + rs.getString("status") + ")");
}
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Binary file not shown.
+22
View File
@@ -0,0 +1,22 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
public class CheckCategories2 {
public static void main(String[] args) {
try {
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
Statement stmt = conn.createStatement();
System.out.println("--- CATEGORIES ---");
ResultSet rs = stmt.executeQuery("SELECT id, name, slug FROM sis_category");
while (rs.next()) {
System.out.println(rs.getLong("id") + " - " + rs.getString("name") + " (" + rs.getString("slug") + ")");
}
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Binary file not shown.
@@ -3,15 +3,18 @@ import java.sql.DriverManager;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.Statement; import java.sql.Statement;
public class CheckPosts { public class CheckComponents {
public static void main(String[] args) { public static void main(String[] args) {
try { try {
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam"); Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
Statement stmt = conn.createStatement(); Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT id, slug, featured_image FROM sis_post WHERE featured_image IS NOT NULL");
System.out.println("--- COMPONENT TEMPLATES ---");
ResultSet rs = stmt.executeQuery("SELECT slug, name FROM sis_component_template");
while (rs.next()) { while (rs.next()) {
System.out.println("ID: " + rs.getLong("id") + " Slug: " + rs.getString("slug") + " IMG: " + rs.getString("featured_image")); System.out.println(rs.getString("slug") + " - " + rs.getString("name"));
} }
conn.close();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
Binary file not shown.
+27
View File
@@ -0,0 +1,27 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
public class CheckJson {
public static void main(String[] args) {
try {
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
PreparedStatement stmt = conn.prepareStatement(
"SELECT id, slug, data_json FROM sis_page"
);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
System.out.println("ID: " + rs.getLong("id") + " Slug: " + rs.getString("slug"));
String json = rs.getString("data_json");
if (json != null && json.contains("livestream_posts")) {
System.out.println("Found livestream_posts in page: " + rs.getString("slug"));
}
}
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Binary file not shown.
+20
View File
@@ -0,0 +1,20 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
public class CheckNewsEventsTemplate {
public static void main(String[] args) {
try {
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT html_template FROM sis_component_template WHERE slug = 'news-events'");
if (rs.next()) {
System.out.println(rs.getString("html_template"));
}
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Binary file not shown.
Binary file not shown.
+23
View File
@@ -0,0 +1,23 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
public class CheckPosts {
public static void main(String[] args) {
try {
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
PreparedStatement stmt = conn.prepareStatement(
"SELECT id, slug, title FROM sis_post ORDER BY id DESC FETCH FIRST 10 ROWS ONLY"
);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
System.out.println("ID: " + rs.getLong("id") + " Slug: " + rs.getString("slug") + " Title: " + rs.getString("title"));
}
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Binary file not shown.
Binary file not shown.
+23
View File
@@ -0,0 +1,23 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
public class CheckTables {
public static void main(String[] args) {
try {
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
PreparedStatement stmt = conn.prepareStatement(
"SELECT table_name FROM user_tables"
);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
System.out.println("Table: " + rs.getString("table_name"));
}
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Binary file not shown.
+22
View File
@@ -0,0 +1,22 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
public class CheckTag {
public static void main(String[] args) {
try {
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
PreparedStatement stmt = conn.prepareStatement("SELECT tag_id FROM sis_post_tag WHERE post_id = 6450");
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
System.out.println("Tag ID: " + rs.getLong(1));
}
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Binary file not shown.
+28
View File
@@ -0,0 +1,28 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
public class CheckTags {
public static void main(String[] args) {
try {
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
Statement stmt = conn.createStatement();
System.out.println("--- TAGS ---");
ResultSet rs = stmt.executeQuery("SELECT id, name, slug FROM sis_tag");
while (rs.next()) {
System.out.println(rs.getLong("id") + " - " + rs.getString("name") + " (" + rs.getString("slug") + ")");
}
System.out.println("--- POST TAGS ---");
rs = stmt.executeQuery("SELECT post_id, tag_id FROM sis_post_tag");
while (rs.next()) {
System.out.println("Post: " + rs.getLong("post_id") + " - Tag: " + rs.getLong("tag_id"));
}
conn.close();
} catch (Exception e) {
System.out.println("Error: " + e.getMessage());
}
}
}
Binary file not shown.
+105
View File
@@ -0,0 +1,105 @@
import java.io.File;
import java.nio.file.Files;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class PopulateLivestream {
public static void main(String[] args) {
try {
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
// Get category ID
PreparedStatement catStmt = conn.prepareStatement("SELECT id FROM sis_category WHERE slug = 'livestream'");
ResultSet rsCat = catStmt.executeQuery();
long catId = -1;
if (rsCat.next()) {
catId = rsCat.getLong("id");
}
if (catId == -1) {
System.out.println("Category 'livestream' not found!");
return;
}
// Delete old posts
PreparedStatement delStmt = conn.prepareStatement("DELETE FROM sis_post WHERE category_id = ?");
delStmt.setLong(1, catId);
delStmt.executeUpdate();
String baseDir = "/home/x79/sisvietnamvn_01/Media/Livestream";
String uploadDir = "/home/x79/sisvietnamvn_01/sisvietnamvn_main/src/main/resources/static/upload/livestream";
new File(uploadDir).mkdirs();
long currentId = 6500;
for (int i = 1; i <= 4; i++) {
String folder = baseDir + "/Tuan" + i;
File f = new File(folder);
if (!f.exists()) continue;
String title = "Tuần " + i;
String excerpt = "";
StringBuilder content = new StringBuilder();
String metaDesc = "";
String imageUrl = "";
File contentFile = new File(folder, "content.txt");
if (contentFile.exists()) {
List<String> lines = Files.readAllLines(contentFile.toPath());
if (lines.size() > 0) title = lines.get(0);
if (lines.size() > 1) excerpt = lines.get(1);
for (int j = 2; j < lines.size(); j++) {
content.append(lines.get(j)).append("<br>");
}
}
File embedFile = new File(folder, "embed.txt");
if (!embedFile.exists()) embedFile = new File(folder, "url.txt");
if (embedFile.exists()) {
String embedStr = Files.readString(embedFile.toPath());
Matcher m = Pattern.compile("src=\"([^\"]+)\"").matcher(embedStr);
if (m.find()) {
metaDesc = m.group(1);
}
}
for (File img : f.listFiles()) {
if (img.getName().endsWith(".jpg") || img.getName().endsWith(".png")) {
File dest = new File(uploadDir, "tuan" + i + "_" + img.getName());
Files.copy(img.toPath(), dest.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
imageUrl = "/upload/livestream/" + dest.getName();
break;
}
}
String slug = "livestream-tuan-" + i;
PreparedStatement insertStmt = conn.prepareStatement(
"INSERT INTO sis_post (id, slug, title, excerpt, content, meta_description, featured_image, category_id, created_date, is_published, views) " +
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, SYSDATE, 1, 0)"
);
insertStmt.setLong(1, currentId++);
insertStmt.setString(2, slug);
insertStmt.setString(3, title);
insertStmt.setString(4, excerpt);
insertStmt.setString(5, content.toString());
insertStmt.setString(6, metaDesc);
insertStmt.setString(7, imageUrl);
insertStmt.setLong(8, catId);
insertStmt.executeUpdate();
System.out.println("Inserted Tuan " + i);
}
conn.close();
System.out.println("Done.");
} catch (Exception e) {
e.printStackTrace();
}
}
}
Binary file not shown.
+126
View File
@@ -0,0 +1,126 @@
import java.io.File;
import java.nio.file.Files;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.util.List;
import java.util.stream.Collectors;
public class PopulateLivestreamFinal {
public static void main(String[] args) {
try {
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
long tagId = 6351;
// Delete old tags first, then old posts
PreparedStatement delTagStmt = conn.prepareStatement(
"DELETE FROM sis_post_tag WHERE tag_id = ?");
delTagStmt.setLong(1, tagId);
delTagStmt.executeUpdate();
PreparedStatement delStmt = conn.prepareStatement(
"DELETE FROM sis_post WHERE id BETWEEN 6600 AND 6610");
delStmt.executeUpdate();
String baseDir = "/home/x79/sisvietnamvn_01/Media/Livestream";
String uploadDir = "/home/x79/sisvietnamvn_01/sisvietnamvn_main/src/main/resources/static/upload/livestream";
new File(uploadDir).mkdirs();
long currentId = 6600;
for (int i = 1; i <= 4; i++) {
String folder = baseDir + "/Tuan" + i;
File f = new File(folder);
if (!f.exists()) continue;
// Title is just the week number for tab display
String title = String.valueOf(i);
// Excerpt is the short topic headline (line 2 of content.txt, after the program name)
String excerpt = "";
StringBuilder content = new StringBuilder();
String metaDescRaw = "";
String imageUrl = "";
File contentFile = new File(folder, "content.txt");
if (contentFile.exists()) {
List<String> lines = Files.readAllLines(contentFile.toPath())
.stream().filter(l -> !l.trim().isEmpty()).collect(Collectors.toList());
// Line 0 = full program name (used as excerpt/subtitle)
// Extract the topic after "Chủ đề:" if present
if (lines.size() > 0) {
String fullTitle = lines.get(0);
int chuDeIdx = fullTitle.indexOf("Chủ đề:");
if (chuDeIdx >= 0) {
excerpt = fullTitle.substring(chuDeIdx + "Chủ đề:".length()).trim();
} else {
chuDeIdx = fullTitle.indexOf("Chủ đề: ");
if (chuDeIdx >= 0) {
excerpt = fullTitle.substring(chuDeIdx + "Chủ đề: ".length()).trim();
} else {
excerpt = fullTitle;
}
}
}
// Line 1 onward = description content
if (lines.size() > 1) {
// Take first 2-3 meaningful lines as description
int maxLines = Math.min(lines.size(), 4);
for (int j = 1; j < maxLines; j++) {
content.append(lines.get(j));
if (j < maxLines - 1) content.append("<br>");
}
}
}
File embedFile = new File(folder, "embed.txt");
if (embedFile.exists()) {
metaDescRaw = Files.readString(embedFile.toPath()).trim();
}
// Find image
for (File img : f.listFiles()) {
String name = img.getName().toLowerCase();
if (name.endsWith(".jpg") || name.endsWith(".png") || name.endsWith(".jpeg")) {
File dest = new File(uploadDir, "tuan" + i + "_" + img.getName());
Files.copy(img.toPath(), dest.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
imageUrl = "/upload/livestream/" + dest.getName();
break;
}
}
String slug = "livestream-tuan-" + i;
PreparedStatement insertStmt = conn.prepareStatement(
"INSERT INTO sis_post (id, slug, title, excerpt, content, meta_description, featured_image, category_id, created_date, status, layout, created_by) " +
"VALUES (?, ?, ?, ?, ?, ?, ?, NULL, SYSDATE, 'PUBLISHED', 'STANDARD', 'admin')"
);
insertStmt.setLong(1, currentId);
insertStmt.setString(2, slug);
insertStmt.setString(3, title);
insertStmt.setString(4, excerpt);
insertStmt.setString(5, content.toString());
insertStmt.setString(6, metaDescRaw);
insertStmt.setString(7, imageUrl);
insertStmt.executeUpdate();
PreparedStatement tagStmt = conn.prepareStatement(
"INSERT INTO sis_post_tag (post_id, tag_id) VALUES (?, ?)");
tagStmt.setLong(1, currentId);
tagStmt.setLong(2, tagId);
tagStmt.executeUpdate();
currentId++;
System.out.println("Inserted Tuan " + i + " | excerpt=" + excerpt + " | image=" + imageUrl);
}
conn.close();
System.out.println("Done populating livestream data.");
} catch (Exception e) {
e.printStackTrace();
}
}
}
Binary file not shown.
+100
View File
@@ -0,0 +1,100 @@
import java.io.File;
import java.nio.file.Files;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.List;
import java.util.stream.Collectors;
public class PopulateLivestreamRaw {
public static void main(String[] args) {
try {
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
// Get tag ID
long tagId = 6351; // Hardcoded from CheckTag
// Delete old tags
PreparedStatement delTagStmt = conn.prepareStatement("DELETE FROM sis_post_tag WHERE post_id IN (SELECT id FROM sis_post WHERE category_id IS NULL) OR tag_id = ?");
delTagStmt.setLong(1, tagId);
delTagStmt.executeUpdate();
// Delete old posts
PreparedStatement delStmt = conn.prepareStatement("DELETE FROM sis_post WHERE id = 6450 OR id >= 6600");
delStmt.executeUpdate();
String baseDir = "/home/x79/sisvietnamvn_01/Media/Livestream";
String uploadDir = "/home/x79/sisvietnamvn_01/sisvietnamvn_main/src/main/resources/static/upload/livestream";
new File(uploadDir).mkdirs();
long currentId = 6600;
for (int i = 1; i <= 4; i++) {
String folder = baseDir + "/Tuan" + i;
File f = new File(folder);
if (!f.exists()) continue;
String title = "Tuần " + i;
String excerpt = "Tuần " + i;
StringBuilder content = new StringBuilder();
String metaDescRaw = "";
String imageUrl = "";
File contentFile = new File(folder, "content.txt");
if (contentFile.exists()) {
List<String> lines = Files.readAllLines(contentFile.toPath()).stream().filter(l -> !l.trim().isEmpty()).collect(Collectors.toList());
if (lines.size() > 0) title = lines.get(0);
if (lines.size() > 1) excerpt = lines.get(1);
for (int j = 2; j < lines.size(); j++) {
content.append(lines.get(j)).append("<br>");
}
}
File embedFile = new File(folder, "embed.txt");
if (!embedFile.exists()) embedFile = new File(folder, "url.txt");
if (embedFile.exists()) {
metaDescRaw = Files.readString(embedFile.toPath()); // Keep entire raw iframe
}
for (File img : f.listFiles()) {
if (img.getName().endsWith(".jpg") || img.getName().endsWith(".png")) {
File dest = new File(uploadDir, "tuan" + i + "_" + img.getName());
Files.copy(img.toPath(), dest.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
imageUrl = "/upload/livestream/" + dest.getName();
break;
}
}
String slug = "livestream-tuan-" + i;
PreparedStatement insertStmt = conn.prepareStatement(
"INSERT INTO sis_post (id, slug, title, excerpt, content, meta_description, featured_image, category_id, created_date, status, layout, created_by) " +
"VALUES (?, ?, ?, ?, ?, ?, ?, NULL, SYSDATE, 'PUBLISHED', 'STANDARD', 'admin')"
);
insertStmt.setLong(1, currentId);
insertStmt.setString(2, slug);
insertStmt.setString(3, title);
insertStmt.setString(4, excerpt);
insertStmt.setString(5, content.toString());
insertStmt.setString(6, metaDescRaw);
insertStmt.setString(7, imageUrl);
insertStmt.executeUpdate();
PreparedStatement tagStmt = conn.prepareStatement("INSERT INTO sis_post_tag (post_id, tag_id) VALUES (?, ?)");
tagStmt.setLong(1, currentId);
tagStmt.setLong(2, tagId);
tagStmt.executeUpdate();
currentId++;
System.out.println("Inserted Tuan " + i);
}
conn.close();
System.out.println("Done.");
} catch (Exception e) {
e.printStackTrace();
}
}
}
Binary file not shown.
+88
View File
@@ -0,0 +1,88 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
public class PopulateNewsEventsEducation {
public static void main(String[] args) {
try {
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
// Delete old duplicate posts
PreparedStatement delTagStmt = conn.prepareStatement("DELETE FROM sis_post_tag WHERE post_id >= 7000");
delTagStmt.executeUpdate();
PreparedStatement delStmt = conn.prepareStatement("DELETE FROM sis_post WHERE id >= 7000");
delStmt.executeUpdate();
// Get post 4151 to duplicate
PreparedStatement getPost = conn.prepareStatement("SELECT title, excerpt, content, meta_description, featured_image, category_id, layout, created_by FROM sis_post WHERE id = 4151");
ResultSet rs = getPost.executeQuery();
if (!rs.next()) {
System.out.println("Post 4151 not found!");
return;
}
String originalTitle = rs.getString("title");
String excerpt = rs.getString("excerpt");
String content = rs.getString("content");
String metaDesc = rs.getString("meta_description");
String featuredImage = rs.getString("featured_image");
long categoryId = rs.getLong("category_id");
boolean catIsNull = rs.wasNull();
String layout = rs.getString("layout");
String createdBy = rs.getString("created_by");
long currentId = 7000;
long[] tagIds = {4251, 4252, 6151}; // news, event, education
String[] prefixes = {"[Tin Tức] ", "[Sự Kiện] ", "[Đào Tạo] "};
String[] slugPrefixes = {"tin-tuc-", "su-kien-", "dao-tao-"};
PreparedStatement insertStmt = conn.prepareStatement(
"INSERT INTO sis_post (id, slug, title, excerpt, content, meta_description, featured_image, category_id, created_date, status, layout, created_by) " +
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, SYSDATE - ?, 'PUBLISHED', ?, ?)"
);
PreparedStatement tagStmt = conn.prepareStatement("INSERT INTO sis_post_tag (post_id, tag_id) VALUES (?, ?)");
for (int t = 0; t < 3; t++) {
for (int i = 1; i <= 4; i++) {
String title = prefixes[t] + originalTitle + " " + i;
String slug = slugPrefixes[t] + currentId;
insertStmt.setLong(1, currentId);
insertStmt.setString(2, slug);
insertStmt.setString(3, title);
insertStmt.setString(4, excerpt);
insertStmt.setString(5, content);
insertStmt.setString(6, metaDesc);
insertStmt.setString(7, featuredImage);
if (catIsNull) {
insertStmt.setNull(8, java.sql.Types.BIGINT);
} else {
insertStmt.setLong(8, categoryId);
}
insertStmt.setInt(9, i); // Subtract i days to vary dates
insertStmt.setString(10, layout);
insertStmt.setString(11, createdBy);
insertStmt.executeUpdate();
tagStmt.setLong(1, currentId);
tagStmt.setLong(2, tagIds[t]);
tagStmt.executeUpdate();
currentId++;
}
}
conn.close();
System.out.println("Done duplicating posts.");
} catch (Exception e) {
e.printStackTrace();
}
}
}
Binary file not shown.
Binary file not shown.
+159
View File
@@ -0,0 +1,159 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
public class UpdateLivestreamTemplate10 {
public static void main(String[] args) {
try {
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
String htmlTemplate =
"<style>\n" +
"/* ── Livestream Section ── */\n" +
".ls-section { background: #f5f5f5; padding: 40px 0; }\n" +
".ls-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2, 16px); border-left: 5px solid #c0272d; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,0.07); border-radius: 6px; overflow: hidden; }\n" +
"\n" +
"/* Left column */\n" +
".ls-left { padding: 36px 32px 32px 32px; display: flex; flex-direction: column; }\n" +
".ls-heading { font-size: 22px; font-weight: 800; color: #111; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 20px; font-family: 'Inter', 'Segoe UI', sans-serif; }\n" +
"\n" +
"/* Tabs */\n" +
".ls-tabs { display: flex; gap: 0; border-bottom: 2px solid #e0e0e0; margin-bottom: 24px; }\n" +
".ls-tab { padding: 8px 18px; font-size: 14px; font-weight: 600; color: #666; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.2s; text-decoration: none; white-space: nowrap; }\n" +
".ls-tab:hover { color: #c0272d; }\n" +
".ls-tab.active { color: #c0272d; border-bottom-color: #c0272d; }\n" +
"\n" +
"/* Tab panels */\n" +
".ls-panel { display: none; flex-direction: column; flex: 1; }\n" +
".ls-panel.active { display: flex; }\n" +
".ls-panel-title { font-size: 18px; font-weight: 700; color: #222; margin-bottom: 14px; line-height: 1.4; }\n" +
".ls-panel-desc { font-size: 14px; color: #555; line-height: 1.7; margin-bottom: 24px; flex: 1; }\n" +
".ls-btn { display: inline-block; padding: 10px 24px; background: #c0272d; color: #fff; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; border-radius: 4px; text-decoration: none; transition: background 0.2s; align-self: flex-start; }\n" +
".ls-btn:hover { background: #a01f24; }\n" +
"\n" +
"/* Right column — poster image */\n" +
".ls-right { min-height: 360px; position: relative; overflow: hidden; }\n" +
".ls-poster { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; }\n" +
".ls-poster.active { display: block; }\n" +
".ls-poster .ls-thumbnail { width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 2; cursor: pointer; }\n" +
".ls-poster .ls-thumbnail img { width: 100%; height: 100%; object-fit: cover; }\n" +
".ls-play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 70px; height: 70px; background: rgba(192, 39, 45, 0.9); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 3; transition: transform 0.2s, background 0.2s; }\n" +
".ls-play-btn:hover { transform: translate(-50%, -50%) scale(1.1); background: #c0272d; }\n" +
".ls-play-btn::after { content: ''; display: block; border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent #fff; margin-left: 5px; }\n" +
".ls-video-embed { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 1; }\n" +
".ls-video-embed iframe { width: 100%; height: 100%; border: none; }\n" +
"\n" +
"/* ── Responsive ── */\n" +
"@media (max-width: 900px) {\n" +
" .ls-wrapper { grid-template-columns: 1fr; border-left: none; border-top: 5px solid #c0272d; }\n" +
" .ls-left { padding: 28px 20px 24px; }\n" +
" .ls-right { min-height: 260px; position: relative; }\n" +
" .ls-poster { position: relative; }\n" +
" .ls-poster .ls-thumbnail img { height: auto; max-height: 400px; }\n" +
"}\n" +
"@media (max-width: 600px) {\n" +
" .ls-heading { font-size: 18px; }\n" +
" .ls-tab { padding: 6px 12px; font-size: 13px; }\n" +
" .ls-panel-title { font-size: 16px; }\n" +
" .ls-panel-desc { font-size: 13px; }\n" +
" .ls-right { min-height: 200px; }\n" +
" .ls-play-btn { width: 50px; height: 50px; }\n" +
" .ls-play-btn::after { border-width: 9px 0 9px 15px; }\n" +
"}\n" +
"</style>\n" +
"\n" +
"<div class=\"cc--component-container cc--tabbed-media-content ls-section\">\n" +
" <div class=\"c--component c--tabbed-media-content\">\n" +
" <div class=\"ls-wrapper\">\n" +
" <!-- Left Column -->\n" +
" <div class=\"ls-left\">\n" +
" <h2 class=\"ls-heading\">Livestream Tháng 07</h2>\n" +
" <div class=\"ls-tabs\">\n" +
" {{#each livestream_posts}}\n" +
" <a href=\"javascript:void(0)\" class=\"ls-tab\" data-tab=\"ls-panel-{{index}}\" onclick=\"switchLsTab(this)\">Tuần {{title}}</a>\n" +
" {{/each}}\n" +
" </div>\n" +
" {{#each livestream_posts}}\n" +
" <div class=\"ls-panel\" id=\"ls-panel-{{index}}\">\n" +
" <h3 class=\"ls-panel-title\">{{excerpt}}</h3>\n" +
" <div class=\"ls-panel-desc\">{{content}}</div>\n" +
" <a href=\"/post/{{slug}}\" class=\"ls-btn\">Tìm Hiểu Thêm</a>\n" +
" </div>\n" +
" {{/each}}\n" +
" </div>\n" +
" <!-- Right Column — Poster -->\n" +
" <div class=\"ls-right\">\n" +
" {{#each livestream_posts}}\n" +
" <div class=\"ls-poster\" data-poster=\"ls-panel-{{index}}\">\n" +
" <div class=\"ls-thumbnail\" onclick=\"playLsVideo('ls-panel-{{index}}')\">\n" +
" <img src=\"{{featuredImageUrl}}\" alt=\"{{title}}\" loading=\"lazy\">\n" +
" <div class=\"ls-play-btn\"></div>\n" +
" </div>\n" +
" <div class=\"ls-video-embed\" id=\"ls-video-{{index}}\">\n" +
" {{{metaDescriptionRaw}}}\n" +
" </div>\n" +
" </div>\n" +
" {{/each}}\n" +
" </div>\n" +
" </div>\n" +
" </div>\n" +
"</div>\n" +
"\n" +
"<script>\n" +
"function switchLsTab(el) {\n" +
" var tabId = el.getAttribute('data-tab');\n" +
" document.querySelectorAll('.ls-tab').forEach(function(t){t.classList.remove('active');});\n" +
" el.classList.add('active');\n" +
" document.querySelectorAll('.ls-panel').forEach(function(p){p.classList.remove('active');});\n" +
" var panel = document.getElementById(tabId);\n" +
" if(panel) panel.classList.add('active');\n" +
" document.querySelectorAll('.ls-poster').forEach(function(p){\n" +
" p.classList.remove('active');\n" +
" // Pause video when switching tab\n" +
" var iframe = p.querySelector('iframe');\n" +
" if(iframe) { \n" +
" var src = iframe.src;\n" +
" iframe.src = src;\n" +
" }\n" +
" });\n" +
" var poster = document.querySelector('.ls-poster[data-poster=\"'+tabId+'\"]');\n" +
" if(poster) poster.classList.add('active');\n" +
"}\n" +
"function playLsVideo(tabId) {\n" +
" var poster = document.querySelector('.ls-poster[data-poster=\"'+tabId+'\"]');\n" +
" if(poster) {\n" +
" var thumb = poster.querySelector('.ls-thumbnail');\n" +
" var embed = poster.querySelector('.ls-video-embed');\n" +
" var iframe = embed.querySelector('iframe');\n" +
" if (thumb) thumb.style.display = 'none';\n" +
" if (embed) {\n" +
" embed.style.display = 'block';\n" +
" embed.style.zIndex = '4';\n" +
" // Add autoplay parameter to iframe src if not present\n" +
" if (iframe && iframe.src.indexOf('autoplay=1') === -1) {\n" +
" if (iframe.src.indexOf('?') > -1) iframe.src += '&autoplay=1';\n" +
" else iframe.src += '?autoplay=1';\n" +
" }\n" +
" }\n" +
" }\n" +
"}\n" +
"document.addEventListener('DOMContentLoaded', function() {\n" +
" var first = document.querySelector('.ls-tab');\n" +
" if(first) switchLsTab(first);\n" +
"});\n" +
"</script>";
PreparedStatement updateTemplate = conn.prepareStatement(
"UPDATE sis_component_template SET html_template = ? WHERE slug = 'tabbed-livestream'"
);
updateTemplate.setString(1, htmlTemplate);
int rows = updateTemplate.executeUpdate();
System.out.println("Updated " + rows + " row(s).");
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Binary file not shown.
+157
View File
@@ -0,0 +1,157 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
public class UpdateLivestreamTemplate11 {
public static void main(String[] args) {
try {
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
String htmlTemplate =
"<style>\n" +
"/* ── Livestream Section ── */\n" +
".ls-section { background: #f5f5f5; padding: 40px 0; }\n" +
".c--tabbed-media-content { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2, 16px); border-left: 5px solid #c0272d; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,0.07); border-radius: 6px; overflow: hidden; }\n" +
"\n" +
"/* Left column */\n" +
".ls-left { padding: 36px 32px 32px 32px; display: flex; flex-direction: column; }\n" +
".ls-heading { font-size: 22px; font-weight: 800; color: #111; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 20px; font-family: 'Inter', 'Segoe UI', sans-serif; }\n" +
"\n" +
"/* Tabs */\n" +
".ls-tabs { display: flex; gap: 0; border-bottom: 2px solid #e0e0e0; margin-bottom: 24px; }\n" +
".ls-tab { padding: 8px 18px; font-size: 14px; font-weight: 600; color: #666; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.2s; text-decoration: none; white-space: nowrap; }\n" +
".ls-tab:hover { color: #c0272d; }\n" +
".ls-tab.active { color: #c0272d; border-bottom-color: #c0272d; }\n" +
"\n" +
"/* Tab panels */\n" +
".ls-panel { display: none; flex-direction: column; flex: 1; }\n" +
".ls-panel.active { display: flex; }\n" +
".ls-panel-title { font-size: 18px; font-weight: 700; color: #222; margin-bottom: 14px; line-height: 1.4; }\n" +
".ls-panel-desc { font-size: 14px; color: #555; line-height: 1.7; margin-bottom: 24px; flex: 1; }\n" +
".ls-btn { display: inline-block; padding: 10px 24px; background: #c0272d; color: #fff; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; border-radius: 4px; text-decoration: none; transition: background 0.2s; align-self: flex-start; }\n" +
".ls-btn:hover { background: #a01f24; }\n" +
"\n" +
"/* Right column — poster image */\n" +
".ls-right { min-height: 360px; position: relative; overflow: hidden; }\n" +
".ls-poster { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; }\n" +
".ls-poster.active { display: block; }\n" +
".ls-poster .ls-thumbnail { width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 2; cursor: pointer; }\n" +
".ls-poster .ls-thumbnail img { width: 100%; height: 100%; object-fit: cover; }\n" +
".ls-play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 70px; height: 70px; background: rgba(192, 39, 45, 0.9); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 3; transition: transform 0.2s, background 0.2s; }\n" +
".ls-play-btn:hover { transform: translate(-50%, -50%) scale(1.1); background: #c0272d; }\n" +
".ls-play-btn::after { content: ''; display: block; border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent #fff; margin-left: 5px; }\n" +
".ls-video-embed { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 1; }\n" +
".ls-video-embed iframe { width: 100%; height: 100%; border: none; }\n" +
"\n" +
"/* ── Responsive ── */\n" +
"@media (max-width: 900px) {\n" +
" .c--tabbed-media-content { grid-template-columns: 1fr; border-left: none; border-top: 5px solid #c0272d; }\n" +
" .ls-left { padding: 28px 20px 24px; }\n" +
" .ls-right { min-height: 260px; position: relative; }\n" +
" .ls-poster { position: relative; }\n" +
" .ls-poster .ls-thumbnail img { height: auto; max-height: 400px; }\n" +
"}\n" +
"@media (max-width: 600px) {\n" +
" .ls-heading { font-size: 18px; }\n" +
" .ls-tab { padding: 6px 12px; font-size: 13px; }\n" +
" .ls-panel-title { font-size: 16px; }\n" +
" .ls-panel-desc { font-size: 13px; }\n" +
" .ls-right { min-height: 200px; }\n" +
" .ls-play-btn { width: 50px; height: 50px; }\n" +
" .ls-play-btn::after { border-width: 9px 0 9px 15px; }\n" +
"}\n" +
"</style>\n" +
"\n" +
"<div class=\"cc--component-container cc--tabbed-media-content ls-section\">\n" +
" <div class=\"c--component c--tabbed-media-content\">\n" +
" <!-- Left Column -->\n" +
" <div class=\"ls-left\">\n" +
" <h2 class=\"ls-heading\">Livestream Tháng 07</h2>\n" +
" <div class=\"ls-tabs\">\n" +
" {{#each livestream_posts}}\n" +
" <a href=\"javascript:void(0)\" class=\"ls-tab\" data-tab=\"ls-panel-{{index}}\" onclick=\"switchLsTab(this)\">Tuần {{title}}</a>\n" +
" {{/each}}\n" +
" </div>\n" +
" {{#each livestream_posts}}\n" +
" <div class=\"ls-panel\" id=\"ls-panel-{{index}}\">\n" +
" <h3 class=\"ls-panel-title\">{{excerpt}}</h3>\n" +
" <div class=\"ls-panel-desc\">{{content}}</div>\n" +
" <a href=\"/post/{{slug}}\" class=\"ls-btn\">Tìm Hiểu Thêm</a>\n" +
" </div>\n" +
" {{/each}}\n" +
" </div>\n" +
" <!-- Right Column — Poster -->\n" +
" <div class=\"ls-right\">\n" +
" {{#each livestream_posts}}\n" +
" <div class=\"ls-poster\" data-poster=\"ls-panel-{{index}}\">\n" +
" <div class=\"ls-thumbnail\" onclick=\"playLsVideo('ls-panel-{{index}}')\">\n" +
" <img src=\"{{featuredImageUrl}}\" alt=\"{{title}}\" loading=\"lazy\">\n" +
" <div class=\"ls-play-btn\"></div>\n" +
" </div>\n" +
" <div class=\"ls-video-embed\" id=\"ls-video-{{index}}\">\n" +
" {{{metaDescriptionRaw}}}\n" +
" </div>\n" +
" </div>\n" +
" {{/each}}\n" +
" </div>\n" +
" </div>\n" +
"</div>\n" +
"\n" +
"<script>\n" +
"function switchLsTab(el) {\n" +
" var tabId = el.getAttribute('data-tab');\n" +
" document.querySelectorAll('.ls-tab').forEach(function(t){t.classList.remove('active');});\n" +
" el.classList.add('active');\n" +
" document.querySelectorAll('.ls-panel').forEach(function(p){p.classList.remove('active');});\n" +
" var panel = document.getElementById(tabId);\n" +
" if(panel) panel.classList.add('active');\n" +
" document.querySelectorAll('.ls-poster').forEach(function(p){\n" +
" p.classList.remove('active');\n" +
" // Pause video when switching tab\n" +
" var iframe = p.querySelector('iframe');\n" +
" if(iframe) { \n" +
" var src = iframe.src;\n" +
" iframe.src = src;\n" +
" }\n" +
" });\n" +
" var poster = document.querySelector('.ls-poster[data-poster=\"'+tabId+'\"]');\n" +
" if(poster) poster.classList.add('active');\n" +
"}\n" +
"function playLsVideo(tabId) {\n" +
" var poster = document.querySelector('.ls-poster[data-poster=\"'+tabId+'\"]');\n" +
" if(poster) {\n" +
" var thumb = poster.querySelector('.ls-thumbnail');\n" +
" var embed = poster.querySelector('.ls-video-embed');\n" +
" var iframe = embed.querySelector('iframe');\n" +
" if (thumb) thumb.style.display = 'none';\n" +
" if (embed) {\n" +
" embed.style.display = 'block';\n" +
" embed.style.zIndex = '4';\n" +
" // Add autoplay parameter to iframe src if not present\n" +
" if (iframe && iframe.src.indexOf('autoplay=1') === -1) {\n" +
" if (iframe.src.indexOf('?') > -1) iframe.src += '&autoplay=1';\n" +
" else iframe.src += '?autoplay=1';\n" +
" }\n" +
" }\n" +
" }\n" +
"}\n" +
"document.addEventListener('DOMContentLoaded', function() {\n" +
" var first = document.querySelector('.ls-tab');\n" +
" if(first) switchLsTab(first);\n" +
"});\n" +
"</script>";
PreparedStatement updateTemplate = conn.prepareStatement(
"UPDATE sis_component_template SET html_template = ? WHERE slug = 'tabbed-livestream'"
);
updateTemplate.setString(1, htmlTemplate);
int rows = updateTemplate.executeUpdate();
System.out.println("Updated " + rows + " row(s).");
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Binary file not shown.
+156
View File
@@ -0,0 +1,156 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
public class UpdateLivestreamTemplate12 {
public static void main(String[] args) {
try {
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
String htmlTemplate =
"<style>\n" +
"/* ── Livestream Section ── */\n" +
".ls-section { background: #f5f5f5; padding: 40px 0; }\n" +
".c--tabbed-media-content { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2, 16px); border-left: 5px solid #c0272d; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,0.07); border-radius: 6px; overflow: hidden; }\n" +
"\n" +
"/* Left column */\n" +
".ls-left { padding: 36px 32px 32px 32px; display: flex; flex-direction: column; }\n" +
".ls-heading { font-size: 22px; font-weight: 800; color: #111; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 20px; font-family: 'Inter', 'Segoe UI', sans-serif; }\n" +
"\n" +
"/* Tabs */\n" +
".ls-tabs { display: flex; gap: 0; border-bottom: 2px solid #e0e0e0; margin-bottom: 24px; }\n" +
".ls-tab { padding: 8px 18px; font-size: 14px; font-weight: 600; color: #666; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.2s; text-decoration: none; white-space: nowrap; }\n" +
".ls-tab:hover { color: #c0272d; }\n" +
".ls-tab.active { color: #c0272d; border-bottom-color: #c0272d; }\n" +
"\n" +
"/* Tab panels */\n" +
".ls-panel { display: none; flex-direction: column; flex: 1; }\n" +
".ls-panel.active { display: flex; }\n" +
".ls-panel-title { font-size: 18px; font-weight: 700; color: #222; margin-bottom: 14px; line-height: 1.4; }\n" +
".ls-panel-desc { font-size: 14px; color: #555; line-height: 1.7; margin-bottom: 24px; flex: 1; }\n" +
".ls-btn { display: inline-block; padding: 10px 24px; background: #c0272d; color: #fff; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; border-radius: 4px; text-decoration: none; transition: background 0.2s; align-self: flex-start; }\n" +
".ls-btn:hover { background: #a01f24; }\n" +
"\n" +
"/* Right column — poster image */\n" +
".ls-right { min-height: 100%; position: relative; overflow: hidden; }\n" +
".ls-poster { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; }\n" +
".ls-poster.active { display: block; }\n" +
".ls-poster .ls-thumbnail { width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 2; cursor: pointer; }\n" +
".ls-poster .ls-thumbnail img { width: 100%; height: 100%; object-fit: cover; object-position: center; }\n" +
".ls-play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 70px; height: 70px; background: rgba(192, 39, 45, 0.9); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 3; transition: transform 0.2s, background 0.2s; }\n" +
".ls-play-btn:hover { transform: translate(-50%, -50%) scale(1.1); background: #c0272d; }\n" +
".ls-play-btn::after { content: ''; display: block; border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent #fff; margin-left: 5px; }\n" +
".ls-video-embed { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 1; }\n" +
".ls-video-embed iframe { width: 100%; height: 100%; border: none; }\n" +
"\n" +
"/* ── Responsive ── */\n" +
"@media (max-width: 900px) {\n" +
" .c--tabbed-media-content { grid-template-columns: 1fr; border-left: none; border-top: 5px solid #c0272d; }\n" +
" .ls-left { padding: 28px 20px 24px; }\n" +
" .ls-right { min-height: auto; aspect-ratio: 16/9; position: relative; }\n" +
" .ls-poster { position: absolute; width: 100%; height: 100%; }\n" +
" .ls-poster .ls-thumbnail img { height: 100%; width: 100%; object-fit: cover; object-position: center; }\n" +
"}\n" +
"@media (max-width: 600px) {\n" +
" .ls-heading { font-size: 18px; }\n" +
" .ls-tab { padding: 6px 12px; font-size: 13px; }\n" +
" .ls-panel-title { font-size: 16px; }\n" +
" .ls-panel-desc { font-size: 13px; }\n" +
" .ls-play-btn { width: 50px; height: 50px; }\n" +
" .ls-play-btn::after { border-width: 9px 0 9px 15px; }\n" +
"}\n" +
"</style>\n" +
"\n" +
"<div class=\"cc--component-container cc--tabbed-media-content ls-section\">\n" +
" <div class=\"c--component c--tabbed-media-content\">\n" +
" <!-- Left Column -->\n" +
" <div class=\"ls-left\">\n" +
" <h2 class=\"ls-heading\">Livestream Tháng 07</h2>\n" +
" <div class=\"ls-tabs\">\n" +
" {{#each livestream_posts}}\n" +
" <a href=\"javascript:void(0)\" class=\"ls-tab\" data-tab=\"ls-panel-{{index}}\" onclick=\"switchLsTab(this)\">Tuần {{title}}</a>\n" +
" {{/each}}\n" +
" </div>\n" +
" {{#each livestream_posts}}\n" +
" <div class=\"ls-panel\" id=\"ls-panel-{{index}}\">\n" +
" <h3 class=\"ls-panel-title\">{{excerpt}}</h3>\n" +
" <div class=\"ls-panel-desc\">{{content}}</div>\n" +
" <a href=\"/post/{{slug}}\" class=\"ls-btn\">Tìm Hiểu Thêm</a>\n" +
" </div>\n" +
" {{/each}}\n" +
" </div>\n" +
" <!-- Right Column — Poster -->\n" +
" <div class=\"ls-right\">\n" +
" {{#each livestream_posts}}\n" +
" <div class=\"ls-poster\" data-poster=\"ls-panel-{{index}}\">\n" +
" <div class=\"ls-thumbnail\" onclick=\"playLsVideo('ls-panel-{{index}}')\">\n" +
" <img src=\"{{featuredImageUrl}}\" alt=\"{{title}}\" loading=\"lazy\">\n" +
" <div class=\"ls-play-btn\"></div>\n" +
" </div>\n" +
" <div class=\"ls-video-embed\" id=\"ls-video-{{index}}\">\n" +
" {{{metaDescriptionRaw}}}\n" +
" </div>\n" +
" </div>\n" +
" {{/each}}\n" +
" </div>\n" +
" </div>\n" +
"</div>\n" +
"\n" +
"<script>\n" +
"function switchLsTab(el) {\n" +
" var tabId = el.getAttribute('data-tab');\n" +
" document.querySelectorAll('.ls-tab').forEach(function(t){t.classList.remove('active');});\n" +
" el.classList.add('active');\n" +
" document.querySelectorAll('.ls-panel').forEach(function(p){p.classList.remove('active');});\n" +
" var panel = document.getElementById(tabId);\n" +
" if(panel) panel.classList.add('active');\n" +
" document.querySelectorAll('.ls-poster').forEach(function(p){\n" +
" p.classList.remove('active');\n" +
" // Pause video when switching tab\n" +
" var iframe = p.querySelector('iframe');\n" +
" if(iframe) { \n" +
" var src = iframe.src;\n" +
" iframe.src = src;\n" +
" }\n" +
" });\n" +
" var poster = document.querySelector('.ls-poster[data-poster=\"'+tabId+'\"]');\n" +
" if(poster) poster.classList.add('active');\n" +
"}\n" +
"function playLsVideo(tabId) {\n" +
" var poster = document.querySelector('.ls-poster[data-poster=\"'+tabId+'\"]');\n" +
" if(poster) {\n" +
" var thumb = poster.querySelector('.ls-thumbnail');\n" +
" var embed = poster.querySelector('.ls-video-embed');\n" +
" var iframe = embed.querySelector('iframe');\n" +
" if (thumb) thumb.style.display = 'none';\n" +
" if (embed) {\n" +
" embed.style.display = 'block';\n" +
" embed.style.zIndex = '4';\n" +
" // Add autoplay parameter to iframe src if not present\n" +
" if (iframe && iframe.src.indexOf('autoplay=1') === -1) {\n" +
" if (iframe.src.indexOf('?') > -1) iframe.src += '&autoplay=1';\n" +
" else iframe.src += '?autoplay=1';\n" +
" }\n" +
" }\n" +
" }\n" +
"}\n" +
"document.addEventListener('DOMContentLoaded', function() {\n" +
" var first = document.querySelector('.ls-tab');\n" +
" if(first) switchLsTab(first);\n" +
"});\n" +
"</script>";
PreparedStatement updateTemplate = conn.prepareStatement(
"UPDATE sis_component_template SET html_template = ? WHERE slug = 'tabbed-livestream'"
);
updateTemplate.setString(1, htmlTemplate);
int rows = updateTemplate.executeUpdate();
System.out.println("Updated " + rows + " row(s).");
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Binary file not shown.
+156
View File
@@ -0,0 +1,156 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
public class UpdateLivestreamTemplate13 {
public static void main(String[] args) {
try {
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
String htmlTemplate =
"<style>\n" +
"/* ── Livestream Section ── */\n" +
".ls-section { background: #f5f5f5; padding: 40px 0; }\n" +
".c--tabbed-media-content { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2, 16px); overflow: hidden; }\n" +
"\n" +
"/* Left column */\n" +
".ls-left { padding: 36px 32px 32px 0px; display: flex; flex-direction: column; }\n" +
".ls-heading { font-size: 22px; font-weight: 800; color: #111; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 20px; font-family: 'Inter', 'Segoe UI', sans-serif; }\n" +
"\n" +
"/* Tabs */\n" +
".ls-tabs { display: flex; gap: 0; border-bottom: 2px solid #e0e0e0; margin-bottom: 24px; }\n" +
".ls-tab { padding: 8px 18px; font-size: 14px; font-weight: 600; color: #666; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.2s; text-decoration: none; white-space: nowrap; }\n" +
".ls-tab:hover { color: #c0272d; }\n" +
".ls-tab.active { color: #c0272d; border-bottom-color: #c0272d; }\n" +
"\n" +
"/* Tab panels */\n" +
".ls-panel { display: none; flex-direction: column; flex: 1; }\n" +
".ls-panel.active { display: flex; }\n" +
".ls-panel-title { font-size: 18px; font-weight: 700; color: #222; margin-bottom: 14px; line-height: 1.4; }\n" +
".ls-panel-desc { font-size: 14px; color: #555; line-height: 1.7; margin-bottom: 24px; flex: 1; }\n" +
".ls-btn { display: inline-block; padding: 10px 24px; background: #c0272d; color: #fff; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; border-radius: 4px; text-decoration: none; transition: background 0.2s; align-self: flex-start; }\n" +
".ls-btn:hover { background: #a01f24; }\n" +
"\n" +
"/* Right column — poster image */\n" +
".ls-right { min-height: 100%; position: relative; overflow: hidden; }\n" +
".ls-poster { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; }\n" +
".ls-poster.active { display: block; }\n" +
".ls-poster .ls-thumbnail { width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 2; cursor: pointer; }\n" +
".ls-poster .ls-thumbnail img { width: 100%; height: 100%; object-fit: cover; object-position: center; }\n" +
".ls-play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 70px; height: 70px; background: rgba(192, 39, 45, 0.9); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 3; transition: transform 0.2s, background 0.2s; }\n" +
".ls-play-btn:hover { transform: translate(-50%, -50%) scale(1.1); background: #c0272d; }\n" +
".ls-play-btn::after { content: ''; display: block; border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent #fff; margin-left: 5px; }\n" +
".ls-video-embed { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 1; }\n" +
".ls-video-embed iframe { width: 100%; height: 100%; border: none; }\n" +
"\n" +
"/* ── Responsive ── */\n" +
"@media (max-width: 900px) {\n" +
" .c--tabbed-media-content { grid-template-columns: 1fr; border-left: none; border-top: 5px solid #c0272d; }\n" +
" .ls-left { padding: 28px 20px 24px; }\n" +
" .ls-right { min-height: auto; aspect-ratio: 16/9; position: relative; }\n" +
" .ls-poster { position: absolute; width: 100%; height: 100%; }\n" +
" .ls-poster .ls-thumbnail img { height: 100%; width: 100%; object-fit: cover; object-position: center; }\n" +
"}\n" +
"@media (max-width: 600px) {\n" +
" .ls-heading { font-size: 18px; }\n" +
" .ls-tab { padding: 6px 12px; font-size: 13px; }\n" +
" .ls-panel-title { font-size: 16px; }\n" +
" .ls-panel-desc { font-size: 13px; }\n" +
" .ls-play-btn { width: 50px; height: 50px; }\n" +
" .ls-play-btn::after { border-width: 9px 0 9px 15px; }\n" +
"}\n" +
"</style>\n" +
"\n" +
"<div class=\"cc--component-container cc--tabbed-media-content ls-section\">\n" +
" <div class=\"c--component c--tabbed-media-content\">\n" +
" <!-- Left Column -->\n" +
" <div class=\"ls-left\">\n" +
" <h2 class=\"ls-heading\">Livestream Tháng 07</h2>\n" +
" <div class=\"ls-tabs\">\n" +
" {{#each livestream_posts}}\n" +
" <a href=\"javascript:void(0)\" class=\"ls-tab\" data-tab=\"ls-panel-{{index}}\" onclick=\"switchLsTab(this)\">Tuần {{title}}</a>\n" +
" {{/each}}\n" +
" </div>\n" +
" {{#each livestream_posts}}\n" +
" <div class=\"ls-panel\" id=\"ls-panel-{{index}}\">\n" +
" <h3 class=\"ls-panel-title\">{{excerpt}}</h3>\n" +
" <div class=\"ls-panel-desc\">{{content}}</div>\n" +
" <a href=\"/post/{{slug}}\" class=\"ls-btn\">Tìm Hiểu Thêm</a>\n" +
" </div>\n" +
" {{/each}}\n" +
" </div>\n" +
" <!-- Right Column — Poster -->\n" +
" <div class=\"ls-right\">\n" +
" {{#each livestream_posts}}\n" +
" <div class=\"ls-poster\" data-poster=\"ls-panel-{{index}}\">\n" +
" <div class=\"ls-thumbnail\" onclick=\"playLsVideo('ls-panel-{{index}}')\">\n" +
" <img src=\"{{featuredImageUrl}}\" alt=\"{{title}}\" loading=\"lazy\">\n" +
" <div class=\"ls-play-btn\"></div>\n" +
" </div>\n" +
" <div class=\"ls-video-embed\" id=\"ls-video-{{index}}\">\n" +
" {{{metaDescriptionRaw}}}\n" +
" </div>\n" +
" </div>\n" +
" {{/each}}\n" +
" </div>\n" +
" </div>\n" +
"</div>\n" +
"\n" +
"<script>\n" +
"function switchLsTab(el) {\n" +
" var tabId = el.getAttribute('data-tab');\n" +
" document.querySelectorAll('.ls-tab').forEach(function(t){t.classList.remove('active');});\n" +
" el.classList.add('active');\n" +
" document.querySelectorAll('.ls-panel').forEach(function(p){p.classList.remove('active');});\n" +
" var panel = document.getElementById(tabId);\n" +
" if(panel) panel.classList.add('active');\n" +
" document.querySelectorAll('.ls-poster').forEach(function(p){\n" +
" p.classList.remove('active');\n" +
" // Pause video when switching tab\n" +
" var iframe = p.querySelector('iframe');\n" +
" if(iframe) { \n" +
" var src = iframe.src;\n" +
" iframe.src = src;\n" +
" }\n" +
" });\n" +
" var poster = document.querySelector('.ls-poster[data-poster=\"'+tabId+'\"]');\n" +
" if(poster) poster.classList.add('active');\n" +
"}\n" +
"function playLsVideo(tabId) {\n" +
" var poster = document.querySelector('.ls-poster[data-poster=\"'+tabId+'\"]');\n" +
" if(poster) {\n" +
" var thumb = poster.querySelector('.ls-thumbnail');\n" +
" var embed = poster.querySelector('.ls-video-embed');\n" +
" var iframe = embed.querySelector('iframe');\n" +
" if (thumb) thumb.style.display = 'none';\n" +
" if (embed) {\n" +
" embed.style.display = 'block';\n" +
" embed.style.zIndex = '4';\n" +
" // Add autoplay parameter to iframe src if not present\n" +
" if (iframe && iframe.src.indexOf('autoplay=1') === -1) {\n" +
" if (iframe.src.indexOf('?') > -1) iframe.src += '&autoplay=1';\n" +
" else iframe.src += '?autoplay=1';\n" +
" }\n" +
" }\n" +
" }\n" +
"}\n" +
"document.addEventListener('DOMContentLoaded', function() {\n" +
" var first = document.querySelector('.ls-tab');\n" +
" if(first) switchLsTab(first);\n" +
"});\n" +
"</script>";
PreparedStatement updateTemplate = conn.prepareStatement(
"UPDATE sis_component_template SET html_template = ? WHERE slug = 'tabbed-livestream'"
);
updateTemplate.setString(1, htmlTemplate);
int rows = updateTemplate.executeUpdate();
System.out.println("Updated " + rows + " row(s).");
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Binary file not shown.
+156
View File
@@ -0,0 +1,156 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
public class UpdateLivestreamTemplate14 {
public static void main(String[] args) {
try {
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
String htmlTemplate =
"<style>\n" +
"/* ── Livestream Section ── */\n" +
".ls-section { background: #f5f5f5; padding: 40px 0; }\n" +
".c--tabbed-media-content { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2, 16px); overflow: hidden; }\n" +
"\n" +
"/* Left column */\n" +
".ls-left { padding: 36px 32px 32px 0px; display: flex; flex-direction: column; min-height: 450px; }\n" +
".ls-heading { font-size: 22px; font-weight: 800; color: #111; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 20px; font-family: 'Inter', 'Segoe UI', sans-serif; }\n" +
"\n" +
"/* Tabs */\n" +
".ls-tabs { display: flex; gap: 0; border-bottom: 2px solid #e0e0e0; margin-bottom: 24px; }\n" +
".ls-tab { padding: 8px 18px; font-size: 14px; font-weight: 600; color: #666; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.2s; text-decoration: none; white-space: nowrap; }\n" +
".ls-tab:hover { color: #c0272d; }\n" +
".ls-tab.active { color: #c0272d; border-bottom-color: #c0272d; }\n" +
"\n" +
"/* Tab panels */\n" +
".ls-panel { display: none; flex-direction: column; flex: 1; }\n" +
".ls-panel.active { display: flex; }\n" +
".ls-panel-title { font-size: 18px; font-weight: 700; color: #222; margin-bottom: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }\n" +
".ls-panel-desc { font-size: 14px; color: #555; line-height: 1.7; margin-bottom: 24px; flex: 1; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }\n" +
".ls-btn { display: inline-block; padding: 10px 24px; background: #c0272d; color: #fff; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; border-radius: 4px; text-decoration: none; transition: background 0.2s; align-self: flex-start; }\n" +
".ls-btn:hover { background: #a01f24; }\n" +
"\n" +
"/* Right column — poster image */\n" +
".ls-right { min-height: 100%; position: relative; overflow: hidden; }\n" +
".ls-poster { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; }\n" +
".ls-poster.active { display: block; }\n" +
".ls-poster .ls-thumbnail { width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 2; cursor: pointer; }\n" +
".ls-poster .ls-thumbnail img { width: 100%; height: 100%; object-fit: cover; object-position: center; }\n" +
".ls-play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 70px; height: 70px; background: rgba(192, 39, 45, 0.9); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 3; transition: transform 0.2s, background 0.2s; }\n" +
".ls-play-btn:hover { transform: translate(-50%, -50%) scale(1.1); background: #c0272d; }\n" +
".ls-play-btn::after { content: ''; display: block; border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent #fff; margin-left: 5px; }\n" +
".ls-video-embed { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 1; }\n" +
".ls-video-embed iframe { width: 100%; height: 100%; border: none; }\n" +
"\n" +
"/* ── Responsive ── */\n" +
"@media (max-width: 900px) {\n" +
" .c--tabbed-media-content { grid-template-columns: 1fr; border-left: none; border-top: 5px solid #c0272d; }\n" +
" .ls-left { padding: 28px 20px 24px 0px; min-height: auto; }\n" +
" .ls-right { min-height: auto; aspect-ratio: 16/9; position: relative; }\n" +
" .ls-poster { position: absolute; width: 100%; height: 100%; }\n" +
" .ls-poster .ls-thumbnail img { height: 100%; width: 100%; object-fit: cover; object-position: center; }\n" +
"}\n" +
"@media (max-width: 600px) {\n" +
" .ls-heading { font-size: 18px; }\n" +
" .ls-tab { padding: 6px 12px; font-size: 13px; }\n" +
" .ls-panel-title { font-size: 16px; -webkit-line-clamp: 2; }\n" +
" .ls-panel-desc { font-size: 13px; -webkit-line-clamp: 4; }\n" +
" .ls-play-btn { width: 50px; height: 50px; }\n" +
" .ls-play-btn::after { border-width: 9px 0 9px 15px; }\n" +
"}\n" +
"</style>\n" +
"\n" +
"<div class=\"cc--component-container cc--tabbed-media-content ls-section\">\n" +
" <div class=\"c--component c--tabbed-media-content\">\n" +
" <!-- Left Column -->\n" +
" <div class=\"ls-left\">\n" +
" <h2 class=\"ls-heading\">Livestream Tháng 07</h2>\n" +
" <div class=\"ls-tabs\">\n" +
" {{#each livestream_posts}}\n" +
" <a href=\"javascript:void(0)\" class=\"ls-tab\" data-tab=\"ls-panel-{{index}}\" onclick=\"switchLsTab(this)\">Tuần {{title}}</a>\n" +
" {{/each}}\n" +
" </div>\n" +
" {{#each livestream_posts}}\n" +
" <div class=\"ls-panel\" id=\"ls-panel-{{index}}\">\n" +
" <h3 class=\"ls-panel-title\">{{excerpt}}</h3>\n" +
" <div class=\"ls-panel-desc\">{{content}}</div>\n" +
" <a href=\"/post/{{slug}}\" class=\"ls-btn\">Tìm Hiểu Thêm</a>\n" +
" </div>\n" +
" {{/each}}\n" +
" </div>\n" +
" <!-- Right Column — Poster -->\n" +
" <div class=\"ls-right\">\n" +
" {{#each livestream_posts}}\n" +
" <div class=\"ls-poster\" data-poster=\"ls-panel-{{index}}\">\n" +
" <div class=\"ls-thumbnail\" onclick=\"playLsVideo('ls-panel-{{index}}')\">\n" +
" <img src=\"{{featuredImageUrl}}\" alt=\"{{title}}\" loading=\"lazy\">\n" +
" <div class=\"ls-play-btn\"></div>\n" +
" </div>\n" +
" <div class=\"ls-video-embed\" id=\"ls-video-{{index}}\">\n" +
" {{{metaDescriptionRaw}}}\n" +
" </div>\n" +
" </div>\n" +
" {{/each}}\n" +
" </div>\n" +
" </div>\n" +
"</div>\n" +
"\n" +
"<script>\n" +
"function switchLsTab(el) {\n" +
" var tabId = el.getAttribute('data-tab');\n" +
" document.querySelectorAll('.ls-tab').forEach(function(t){t.classList.remove('active');});\n" +
" el.classList.add('active');\n" +
" document.querySelectorAll('.ls-panel').forEach(function(p){p.classList.remove('active');});\n" +
" var panel = document.getElementById(tabId);\n" +
" if(panel) panel.classList.add('active');\n" +
" document.querySelectorAll('.ls-poster').forEach(function(p){\n" +
" p.classList.remove('active');\n" +
" // Pause video when switching tab\n" +
" var iframe = p.querySelector('iframe');\n" +
" if(iframe) { \n" +
" var src = iframe.src;\n" +
" iframe.src = src;\n" +
" }\n" +
" });\n" +
" var poster = document.querySelector('.ls-poster[data-poster=\"'+tabId+'\"]');\n" +
" if(poster) poster.classList.add('active');\n" +
"}\n" +
"function playLsVideo(tabId) {\n" +
" var poster = document.querySelector('.ls-poster[data-poster=\"'+tabId+'\"]');\n" +
" if(poster) {\n" +
" var thumb = poster.querySelector('.ls-thumbnail');\n" +
" var embed = poster.querySelector('.ls-video-embed');\n" +
" var iframe = embed.querySelector('iframe');\n" +
" if (thumb) thumb.style.display = 'none';\n" +
" if (embed) {\n" +
" embed.style.display = 'block';\n" +
" embed.style.zIndex = '4';\n" +
" // Add autoplay parameter to iframe src if not present\n" +
" if (iframe && iframe.src.indexOf('autoplay=1') === -1) {\n" +
" if (iframe.src.indexOf('?') > -1) iframe.src += '&autoplay=1';\n" +
" else iframe.src += '?autoplay=1';\n" +
" }\n" +
" }\n" +
" }\n" +
"}\n" +
"document.addEventListener('DOMContentLoaded', function() {\n" +
" var first = document.querySelector('.ls-tab');\n" +
" if(first) switchLsTab(first);\n" +
"});\n" +
"</script>";
PreparedStatement updateTemplate = conn.prepareStatement(
"UPDATE sis_component_template SET html_template = ? WHERE slug = 'tabbed-livestream'"
);
updateTemplate.setString(1, htmlTemplate);
int rows = updateTemplate.executeUpdate();
System.out.println("Updated " + rows + " row(s).");
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+109
View File
@@ -0,0 +1,109 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
public class UpdateLivestreamTemplate6 {
public static void main(String[] args) {
try {
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
String htmlTemplate =
"<style>\n" +
" .tabbed-media-content-media-item { width: 100%; aspect-ratio: 16/9; position: relative; display: block; overflow: hidden; }\n" +
" .tabbed-media-content-media-item .f--video-embed { width: 100%; height: 100%; }\n" +
" .tabbed-media-content-media-item .f--video-embed iframe { width: 100%; height: 100%; border: none; }\n" +
"</style>\n" +
"<div class=\"cc--component-container cc--tabbed-media-content\" style=\"background-color: var(--color-gray-100);\">\n" +
" <div class=\"c--component c--tabbed-media-content\">\n" +
" <div class=\"tabbed-media-content-text-col\">\n" +
" <div data-component-id=\"umass_base:section-title\" class=\"f--section-title\">\n" +
" <h2 style=\"color: var(--color-brand);\">LiveStream</h2>\n" +
" </div>\n" +
" <div data-component-id=\"umass_base:tabbed-container\" data-once=\"tabbed-container\">\n" +
" <div class=\"tab-labels-container\" role=\"tablist\">\n" +
" <div class=\"tab-labels-inner\">\n" +
" {{#each livestream_posts}}\n" +
" <a href=\"#tabbed-content-{{index}}\" class=\"tab-label link-context-dark\" role=\"tab\" aria-selected=\"false\" aria-controls=\"tabbed-content-{{index}}\">{{title}}</a>\n" +
" {{/each}}\n" +
" </div>\n" +
" </div>\n" +
" <div class=\"tab-content-container\">\n" +
" {{#each livestream_posts}}\n" +
" <div class=\"tab-content-panel\" id=\"tabbed-content-{{index}}\" role=\"tabpanel\" aria-live=\"polite\">\n" +
" <div class=\"f--field f--cta-title\">\n" +
" <h2 style=\"color: var(--color-black);\"> {{excerpt}} </h2>\n" +
" </div>\n" +
" <div data-component-id=\"umass_base:description\" class=\"f--description\">\n" +
" <div style=\"color:var(--color-black);\">{{content}}</div>\n" +
" </div>\n" +
" <div class=\"cta-container\">\n" +
" <div class=\"f--field f--button\">\n" +
" <a href=\"/post/{{slug}}\" class=\"button-primary button-context-light \" aria-label=\"Tìm Hiểu Thêm\" data-component-id=\"umass_base:button\">\n" +
" <span class=\"button-text\"> Tìm Hiểu Thêm </span>\n" +
" </a>\n" +
" </div>\n" +
" </div>\n" +
" </div>\n" +
" {{/each}}\n" +
" </div>\n" +
" </div>\n" +
" </div>\n" +
" <div class=\"tabbed-media-content-media-col\">\n" +
" {{#each livestream_posts}}\n" +
" <div class=\"tabbed-media-content-media-item with-video\" data-tab-id=\"tabbed-content-{{index}}\">\n" +
" <div data-component-id=\"umass_base:video-embed\" class=\"f--field f--video-embed\">\n" +
" {{{metaDescriptionRaw}}}\n" +
" </div>\n" +
" </div>\n" +
" {{/each}}\n" +
" </div>\n" +
" </div>\n" +
"</div>\n" +
"<script>\n" +
" document.addEventListener(\"DOMContentLoaded\", function() {\n" +
" var tabs = document.querySelectorAll('.tabbed-media-content-media-item[data-tab-id=\"tabbed-content-0\"]');\n" +
" if(tabs.length > 0) tabs[0].classList.add('is-active');\n" +
" \n" +
" var panels = document.querySelectorAll('#tabbed-content-0.tab-content-panel');\n" +
" if(panels.length > 0) panels[0].classList.add('is-active');\n" +
"\n" +
" var labels = document.querySelectorAll('a.tab-label[aria-controls=\"tabbed-content-0\"]');\n" +
" if(labels.length > 0) labels[0].setAttribute('aria-selected', 'true');\n" +
"\n" +
" var allLabels = document.querySelectorAll('.tab-labels-inner .tab-label');\n" +
" allLabels.forEach(function(label) {\n" +
" label.addEventListener('click', function(e) {\n" +
" e.preventDefault();\n" +
" allLabels.forEach(function(l) { l.setAttribute('aria-selected', 'false'); });\n" +
" this.setAttribute('aria-selected', 'true');\n" +
" \n" +
" var targetId = this.getAttribute('aria-controls');\n" +
" document.querySelectorAll('.tab-content-panel').forEach(function(p) { p.classList.remove('is-active'); });\n" +
" document.querySelectorAll('.tabbed-media-content-media-item').forEach(function(m) { \n" +
" m.classList.remove('is-active'); \n" +
" });\n" +
" \n" +
" var targetPanel = document.getElementById(targetId);\n" +
" if(targetPanel) targetPanel.classList.add('is-active');\n" +
" var targetMedia = document.querySelector('.tabbed-media-content-media-item[data-tab-id=\"' + targetId + '\"]');\n" +
" if(targetMedia) targetMedia.classList.add('is-active');\n" +
" });\n" +
" });\n" +
" });\n" +
"</script>";
PreparedStatement updateTemplate = conn.prepareStatement(
"UPDATE sis_component_template SET html_template = ? WHERE slug = 'tabbed-livestream'"
);
updateTemplate.setString(1, htmlTemplate);
updateTemplate.executeUpdate();
System.out.println("Update complete!");
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Binary file not shown.
+117
View File
@@ -0,0 +1,117 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
public class UpdateLivestreamTemplate7 {
public static void main(String[] args) {
try {
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
String htmlTemplate =
"<style>\n" +
"/* ── Livestream Section ── */\n" +
".ls-section { background: #f5f5f5; padding: 40px 0; }\n" +
".ls-wrapper { max-width: 1200px; margin: 0 auto; display: flex; gap: 0; border-left: 5px solid #c0272d; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,0.07); border-radius: 6px; overflow: hidden; }\n" +
"\n" +
"/* Left column */\n" +
".ls-left { flex: 0 0 40%; max-width: 40%; padding: 36px 32px 32px 32px; display: flex; flex-direction: column; }\n" +
".ls-heading { font-size: 22px; font-weight: 800; color: #111; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 20px; font-family: 'Inter', 'Segoe UI', sans-serif; }\n" +
"\n" +
"/* Tabs */\n" +
".ls-tabs { display: flex; gap: 0; border-bottom: 2px solid #e0e0e0; margin-bottom: 24px; }\n" +
".ls-tab { padding: 8px 18px; font-size: 14px; font-weight: 600; color: #666; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.2s; text-decoration: none; white-space: nowrap; }\n" +
".ls-tab:hover { color: #c0272d; }\n" +
".ls-tab.active { color: #c0272d; border-bottom-color: #c0272d; }\n" +
"\n" +
"/* Tab panels */\n" +
".ls-panel { display: none; flex-direction: column; flex: 1; }\n" +
".ls-panel.active { display: flex; }\n" +
".ls-panel-title { font-size: 18px; font-weight: 700; color: #222; margin-bottom: 14px; line-height: 1.4; }\n" +
".ls-panel-desc { font-size: 14px; color: #555; line-height: 1.7; margin-bottom: 24px; flex: 1; }\n" +
".ls-btn { display: inline-block; padding: 10px 24px; background: #c0272d; color: #fff; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; border-radius: 4px; text-decoration: none; transition: background 0.2s; align-self: flex-start; }\n" +
".ls-btn:hover { background: #a01f24; }\n" +
"\n" +
"/* Right column — poster image */\n" +
".ls-right { flex: 1; min-height: 360px; position: relative; overflow: hidden; }\n" +
".ls-poster { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; }\n" +
".ls-poster.active { display: block; }\n" +
".ls-poster img { width: 100%; height: 100%; object-fit: cover; }\n" +
"\n" +
"/* ── Responsive ── */\n" +
"@media (max-width: 900px) {\n" +
" .ls-wrapper { flex-direction: column; border-left: none; border-top: 5px solid #c0272d; }\n" +
" .ls-left { flex: none; max-width: 100%; padding: 28px 20px 24px; }\n" +
" .ls-right { min-height: 260px; position: relative; }\n" +
" .ls-poster { position: relative; }\n" +
" .ls-poster img { height: auto; max-height: 400px; }\n" +
"}\n" +
"@media (max-width: 600px) {\n" +
" .ls-heading { font-size: 18px; }\n" +
" .ls-tab { padding: 6px 12px; font-size: 13px; }\n" +
" .ls-panel-title { font-size: 16px; }\n" +
" .ls-panel-desc { font-size: 13px; }\n" +
" .ls-right { min-height: 200px; }\n" +
"}\n" +
"</style>\n" +
"\n" +
"<section class=\"ls-section\">\n" +
" <div class=\"ls-wrapper\">\n" +
" <!-- Left Column -->\n" +
" <div class=\"ls-left\">\n" +
" <h2 class=\"ls-heading\">Livestream Tháng 07</h2>\n" +
" <div class=\"ls-tabs\">\n" +
" {{#each livestream_posts}}\n" +
" <a href=\"javascript:void(0)\" class=\"ls-tab\" data-tab=\"ls-panel-{{index}}\" onclick=\"switchLsTab(this)\">Tuần {{title}}</a>\n" +
" {{/each}}\n" +
" </div>\n" +
" {{#each livestream_posts}}\n" +
" <div class=\"ls-panel\" id=\"ls-panel-{{index}}\">\n" +
" <h3 class=\"ls-panel-title\">{{excerpt}}</h3>\n" +
" <div class=\"ls-panel-desc\">{{content}}</div>\n" +
" <a href=\"/post/{{slug}}\" class=\"ls-btn\">Tìm Hiểu Thêm</a>\n" +
" </div>\n" +
" {{/each}}\n" +
" </div>\n" +
" <!-- Right Column — Poster -->\n" +
" <div class=\"ls-right\">\n" +
" {{#each livestream_posts}}\n" +
" <div class=\"ls-poster\" data-poster=\"ls-panel-{{index}}\">\n" +
" <img src=\"{{featuredImageUrl}}\" alt=\"{{title}}\" loading=\"lazy\">\n" +
" </div>\n" +
" {{/each}}\n" +
" </div>\n" +
" </div>\n" +
"</section>\n" +
"\n" +
"<script>\n" +
"function switchLsTab(el) {\n" +
" var tabId = el.getAttribute('data-tab');\n" +
" document.querySelectorAll('.ls-tab').forEach(function(t){t.classList.remove('active');});\n" +
" el.classList.add('active');\n" +
" document.querySelectorAll('.ls-panel').forEach(function(p){p.classList.remove('active');});\n" +
" var panel = document.getElementById(tabId);\n" +
" if(panel) panel.classList.add('active');\n" +
" document.querySelectorAll('.ls-poster').forEach(function(p){p.classList.remove('active');});\n" +
" var poster = document.querySelector('.ls-poster[data-poster=\"'+tabId+'\"]');\n" +
" if(poster) poster.classList.add('active');\n" +
"}\n" +
"document.addEventListener('DOMContentLoaded', function() {\n" +
" var first = document.querySelector('.ls-tab');\n" +
" if(first) switchLsTab(first);\n" +
"});\n" +
"</script>";
PreparedStatement updateTemplate = conn.prepareStatement(
"UPDATE sis_component_template SET html_template = ? WHERE slug = 'tabbed-livestream'"
);
updateTemplate.setString(1, htmlTemplate);
int rows = updateTemplate.executeUpdate();
System.out.println("Updated " + rows + " row(s).");
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Binary file not shown.
+157
View File
@@ -0,0 +1,157 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
public class UpdateLivestreamTemplate8 {
public static void main(String[] args) {
try {
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
String htmlTemplate =
"<style>\n" +
"/* ── Livestream Section ── */\n" +
".ls-section { background: #f5f5f5; padding: 40px 0; }\n" +
".ls-wrapper { max-width: 1200px; margin: 0 auto; display: flex; gap: 0; border-left: 5px solid #c0272d; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,0.07); border-radius: 6px; overflow: hidden; }\n" +
"\n" +
"/* Left column */\n" +
".ls-left { flex: 0 0 40%; max-width: 40%; padding: 36px 32px 32px 32px; display: flex; flex-direction: column; }\n" +
".ls-heading { font-size: 22px; font-weight: 800; color: #111; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 20px; font-family: 'Inter', 'Segoe UI', sans-serif; }\n" +
"\n" +
"/* Tabs */\n" +
".ls-tabs { display: flex; gap: 0; border-bottom: 2px solid #e0e0e0; margin-bottom: 24px; }\n" +
".ls-tab { padding: 8px 18px; font-size: 14px; font-weight: 600; color: #666; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.2s; text-decoration: none; white-space: nowrap; }\n" +
".ls-tab:hover { color: #c0272d; }\n" +
".ls-tab.active { color: #c0272d; border-bottom-color: #c0272d; }\n" +
"\n" +
"/* Tab panels */\n" +
".ls-panel { display: none; flex-direction: column; flex: 1; }\n" +
".ls-panel.active { display: flex; }\n" +
".ls-panel-title { font-size: 18px; font-weight: 700; color: #222; margin-bottom: 14px; line-height: 1.4; }\n" +
".ls-panel-desc { font-size: 14px; color: #555; line-height: 1.7; margin-bottom: 24px; flex: 1; }\n" +
".ls-btn { display: inline-block; padding: 10px 24px; background: #c0272d; color: #fff; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; border-radius: 4px; text-decoration: none; transition: background 0.2s; align-self: flex-start; }\n" +
".ls-btn:hover { background: #a01f24; }\n" +
"\n" +
"/* Right column — poster image */\n" +
".ls-right { flex: 1; min-height: 360px; position: relative; overflow: hidden; }\n" +
".ls-poster { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; }\n" +
".ls-poster.active { display: block; }\n" +
".ls-poster .ls-thumbnail { width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 2; cursor: pointer; }\n" +
".ls-poster .ls-thumbnail img { width: 100%; height: 100%; object-fit: cover; }\n" +
".ls-play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 70px; height: 70px; background: rgba(192, 39, 45, 0.9); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 3; transition: transform 0.2s, background 0.2s; }\n" +
".ls-play-btn:hover { transform: translate(-50%, -50%) scale(1.1); background: #c0272d; }\n" +
".ls-play-btn::after { content: ''; display: block; border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent #fff; margin-left: 5px; }\n" +
".ls-video-embed { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 1; }\n" +
".ls-video-embed iframe { width: 100%; height: 100%; border: none; }\n" +
"\n" +
"/* ── Responsive ── */\n" +
"@media (max-width: 900px) {\n" +
" .ls-wrapper { flex-direction: column; border-left: none; border-top: 5px solid #c0272d; }\n" +
" .ls-left { flex: none; max-width: 100%; padding: 28px 20px 24px; }\n" +
" .ls-right { min-height: 260px; position: relative; }\n" +
" .ls-poster { position: relative; }\n" +
" .ls-poster .ls-thumbnail img { height: auto; max-height: 400px; }\n" +
"}\n" +
"@media (max-width: 600px) {\n" +
" .ls-heading { font-size: 18px; }\n" +
" .ls-tab { padding: 6px 12px; font-size: 13px; }\n" +
" .ls-panel-title { font-size: 16px; }\n" +
" .ls-panel-desc { font-size: 13px; }\n" +
" .ls-right { min-height: 200px; }\n" +
" .ls-play-btn { width: 50px; height: 50px; }\n" +
" .ls-play-btn::after { border-width: 9px 0 9px 15px; }\n" +
"}\n" +
"</style>\n" +
"\n" +
"<section class=\"ls-section\">\n" +
" <div class=\"ls-wrapper\">\n" +
" <!-- Left Column -->\n" +
" <div class=\"ls-left\">\n" +
" <h2 class=\"ls-heading\">Livestream Tháng 07</h2>\n" +
" <div class=\"ls-tabs\">\n" +
" {{#each livestream_posts}}\n" +
" <a href=\"javascript:void(0)\" class=\"ls-tab\" data-tab=\"ls-panel-{{index}}\" onclick=\"switchLsTab(this)\">Tuần {{title}}</a>\n" +
" {{/each}}\n" +
" </div>\n" +
" {{#each livestream_posts}}\n" +
" <div class=\"ls-panel\" id=\"ls-panel-{{index}}\">\n" +
" <h3 class=\"ls-panel-title\">{{excerpt}}</h3>\n" +
" <div class=\"ls-panel-desc\">{{content}}</div>\n" +
" <a href=\"/post/{{slug}}\" class=\"ls-btn\">Tìm Hiểu Thêm</a>\n" +
" </div>\n" +
" {{/each}}\n" +
" </div>\n" +
" <!-- Right Column — Poster -->\n" +
" <div class=\"ls-right\">\n" +
" {{#each livestream_posts}}\n" +
" <div class=\"ls-poster\" data-poster=\"ls-panel-{{index}}\">\n" +
" <div class=\"ls-thumbnail\" onclick=\"playLsVideo('ls-panel-{{index}}')\">\n" +
" <img src=\"{{featuredImageUrl}}\" alt=\"{{title}}\" loading=\"lazy\">\n" +
" <div class=\"ls-play-btn\"></div>\n" +
" </div>\n" +
" <div class=\"ls-video-embed\" id=\"ls-video-{{index}}\">\n" +
" {{{metaDescriptionRaw}}}\n" +
" </div>\n" +
" </div>\n" +
" {{/each}}\n" +
" </div>\n" +
" </div>\n" +
"</section>\n" +
"\n" +
"<script>\n" +
"function switchLsTab(el) {\n" +
" var tabId = el.getAttribute('data-tab');\n" +
" document.querySelectorAll('.ls-tab').forEach(function(t){t.classList.remove('active');});\n" +
" el.classList.add('active');\n" +
" document.querySelectorAll('.ls-panel').forEach(function(p){p.classList.remove('active');});\n" +
" var panel = document.getElementById(tabId);\n" +
" if(panel) panel.classList.add('active');\n" +
" document.querySelectorAll('.ls-poster').forEach(function(p){\n" +
" p.classList.remove('active');\n" +
" // Pause video when switching tab\n" +
" var iframe = p.querySelector('iframe');\n" +
" if(iframe) { \n" +
" var src = iframe.src;\n" +
" iframe.src = src;\n" +
" }\n" +
" });\n" +
" var poster = document.querySelector('.ls-poster[data-poster=\"'+tabId+'\"]');\n" +
" if(poster) poster.classList.add('active');\n" +
"}\n" +
"function playLsVideo(tabId) {\n" +
" var poster = document.querySelector('.ls-poster[data-poster=\"'+tabId+'\"]');\n" +
" if(poster) {\n" +
" var thumb = poster.querySelector('.ls-thumbnail');\n" +
" var embed = poster.querySelector('.ls-video-embed');\n" +
" var iframe = embed.querySelector('iframe');\n" +
" if (thumb) thumb.style.display = 'none';\n" +
" if (embed) {\n" +
" embed.style.display = 'block';\n" +
" embed.style.zIndex = '4';\n" +
" // Add autoplay parameter to iframe src if not present\n" +
" if (iframe && iframe.src.indexOf('autoplay=1') === -1) {\n" +
" if (iframe.src.indexOf('?') > -1) iframe.src += '&autoplay=1';\n" +
" else iframe.src += '?autoplay=1';\n" +
" }\n" +
" }\n" +
" }\n" +
"}\n" +
"document.addEventListener('DOMContentLoaded', function() {\n" +
" var first = document.querySelector('.ls-tab');\n" +
" if(first) switchLsTab(first);\n" +
"});\n" +
"</script>";
PreparedStatement updateTemplate = conn.prepareStatement(
"UPDATE sis_component_template SET html_template = ? WHERE slug = 'tabbed-livestream'"
);
updateTemplate.setString(1, htmlTemplate);
int rows = updateTemplate.executeUpdate();
System.out.println("Updated " + rows + " row(s).");
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Binary file not shown.
+159
View File
@@ -0,0 +1,159 @@
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
public class UpdateLivestreamTemplate9 {
public static void main(String[] args) {
try {
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
String htmlTemplate =
"<style>\n" +
"/* ── Livestream Section ── */\n" +
".ls-section { background: #f5f5f5; padding: 40px 0; }\n" +
".ls-wrapper { display: flex; gap: 0; border-left: 5px solid #c0272d; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,0.07); border-radius: 6px; overflow: hidden; }\n" +
"\n" +
"/* Left column */\n" +
".ls-left { flex: 0 0 40%; max-width: 40%; padding: 36px 32px 32px 32px; display: flex; flex-direction: column; }\n" +
".ls-heading { font-size: 22px; font-weight: 800; color: #111; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 20px; font-family: 'Inter', 'Segoe UI', sans-serif; }\n" +
"\n" +
"/* Tabs */\n" +
".ls-tabs { display: flex; gap: 0; border-bottom: 2px solid #e0e0e0; margin-bottom: 24px; }\n" +
".ls-tab { padding: 8px 18px; font-size: 14px; font-weight: 600; color: #666; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.2s; text-decoration: none; white-space: nowrap; }\n" +
".ls-tab:hover { color: #c0272d; }\n" +
".ls-tab.active { color: #c0272d; border-bottom-color: #c0272d; }\n" +
"\n" +
"/* Tab panels */\n" +
".ls-panel { display: none; flex-direction: column; flex: 1; }\n" +
".ls-panel.active { display: flex; }\n" +
".ls-panel-title { font-size: 18px; font-weight: 700; color: #222; margin-bottom: 14px; line-height: 1.4; }\n" +
".ls-panel-desc { font-size: 14px; color: #555; line-height: 1.7; margin-bottom: 24px; flex: 1; }\n" +
".ls-btn { display: inline-block; padding: 10px 24px; background: #c0272d; color: #fff; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; border-radius: 4px; text-decoration: none; transition: background 0.2s; align-self: flex-start; }\n" +
".ls-btn:hover { background: #a01f24; }\n" +
"\n" +
"/* Right column — poster image */\n" +
".ls-right { flex: 1; min-height: 360px; position: relative; overflow: hidden; }\n" +
".ls-poster { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; }\n" +
".ls-poster.active { display: block; }\n" +
".ls-poster .ls-thumbnail { width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 2; cursor: pointer; }\n" +
".ls-poster .ls-thumbnail img { width: 100%; height: 100%; object-fit: cover; }\n" +
".ls-play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 70px; height: 70px; background: rgba(192, 39, 45, 0.9); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 3; transition: transform 0.2s, background 0.2s; }\n" +
".ls-play-btn:hover { transform: translate(-50%, -50%) scale(1.1); background: #c0272d; }\n" +
".ls-play-btn::after { content: ''; display: block; border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent #fff; margin-left: 5px; }\n" +
".ls-video-embed { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 1; }\n" +
".ls-video-embed iframe { width: 100%; height: 100%; border: none; }\n" +
"\n" +
"/* ── Responsive ── */\n" +
"@media (max-width: 900px) {\n" +
" .ls-wrapper { flex-direction: column; border-left: none; border-top: 5px solid #c0272d; }\n" +
" .ls-left { flex: none; max-width: 100%; padding: 28px 20px 24px; }\n" +
" .ls-right { min-height: 260px; position: relative; }\n" +
" .ls-poster { position: relative; }\n" +
" .ls-poster .ls-thumbnail img { height: auto; max-height: 400px; }\n" +
"}\n" +
"@media (max-width: 600px) {\n" +
" .ls-heading { font-size: 18px; }\n" +
" .ls-tab { padding: 6px 12px; font-size: 13px; }\n" +
" .ls-panel-title { font-size: 16px; }\n" +
" .ls-panel-desc { font-size: 13px; }\n" +
" .ls-right { min-height: 200px; }\n" +
" .ls-play-btn { width: 50px; height: 50px; }\n" +
" .ls-play-btn::after { border-width: 9px 0 9px 15px; }\n" +
"}\n" +
"</style>\n" +
"\n" +
"<div class=\"cc--component-container cc--tabbed-media-content ls-section\">\n" +
" <div class=\"c--component c--tabbed-media-content\">\n" +
" <div class=\"ls-wrapper\">\n" +
" <!-- Left Column -->\n" +
" <div class=\"ls-left\">\n" +
" <h2 class=\"ls-heading\">Livestream Tháng 07</h2>\n" +
" <div class=\"ls-tabs\">\n" +
" {{#each livestream_posts}}\n" +
" <a href=\"javascript:void(0)\" class=\"ls-tab\" data-tab=\"ls-panel-{{index}}\" onclick=\"switchLsTab(this)\">Tuần {{title}}</a>\n" +
" {{/each}}\n" +
" </div>\n" +
" {{#each livestream_posts}}\n" +
" <div class=\"ls-panel\" id=\"ls-panel-{{index}}\">\n" +
" <h3 class=\"ls-panel-title\">{{excerpt}}</h3>\n" +
" <div class=\"ls-panel-desc\">{{content}}</div>\n" +
" <a href=\"/post/{{slug}}\" class=\"ls-btn\">Tìm Hiểu Thêm</a>\n" +
" </div>\n" +
" {{/each}}\n" +
" </div>\n" +
" <!-- Right Column — Poster -->\n" +
" <div class=\"ls-right\">\n" +
" {{#each livestream_posts}}\n" +
" <div class=\"ls-poster\" data-poster=\"ls-panel-{{index}}\">\n" +
" <div class=\"ls-thumbnail\" onclick=\"playLsVideo('ls-panel-{{index}}')\">\n" +
" <img src=\"{{featuredImageUrl}}\" alt=\"{{title}}\" loading=\"lazy\">\n" +
" <div class=\"ls-play-btn\"></div>\n" +
" </div>\n" +
" <div class=\"ls-video-embed\" id=\"ls-video-{{index}}\">\n" +
" {{{metaDescriptionRaw}}}\n" +
" </div>\n" +
" </div>\n" +
" {{/each}}\n" +
" </div>\n" +
" </div>\n" +
" </div>\n" +
"</div>\n" +
"\n" +
"<script>\n" +
"function switchLsTab(el) {\n" +
" var tabId = el.getAttribute('data-tab');\n" +
" document.querySelectorAll('.ls-tab').forEach(function(t){t.classList.remove('active');});\n" +
" el.classList.add('active');\n" +
" document.querySelectorAll('.ls-panel').forEach(function(p){p.classList.remove('active');});\n" +
" var panel = document.getElementById(tabId);\n" +
" if(panel) panel.classList.add('active');\n" +
" document.querySelectorAll('.ls-poster').forEach(function(p){\n" +
" p.classList.remove('active');\n" +
" // Pause video when switching tab\n" +
" var iframe = p.querySelector('iframe');\n" +
" if(iframe) { \n" +
" var src = iframe.src;\n" +
" iframe.src = src;\n" +
" }\n" +
" });\n" +
" var poster = document.querySelector('.ls-poster[data-poster=\"'+tabId+'\"]');\n" +
" if(poster) poster.classList.add('active');\n" +
"}\n" +
"function playLsVideo(tabId) {\n" +
" var poster = document.querySelector('.ls-poster[data-poster=\"'+tabId+'\"]');\n" +
" if(poster) {\n" +
" var thumb = poster.querySelector('.ls-thumbnail');\n" +
" var embed = poster.querySelector('.ls-video-embed');\n" +
" var iframe = embed.querySelector('iframe');\n" +
" if (thumb) thumb.style.display = 'none';\n" +
" if (embed) {\n" +
" embed.style.display = 'block';\n" +
" embed.style.zIndex = '4';\n" +
" // Add autoplay parameter to iframe src if not present\n" +
" if (iframe && iframe.src.indexOf('autoplay=1') === -1) {\n" +
" if (iframe.src.indexOf('?') > -1) iframe.src += '&autoplay=1';\n" +
" else iframe.src += '?autoplay=1';\n" +
" }\n" +
" }\n" +
" }\n" +
"}\n" +
"document.addEventListener('DOMContentLoaded', function() {\n" +
" var first = document.querySelector('.ls-tab');\n" +
" if(first) switchLsTab(first);\n" +
"});\n" +
"</script>";
PreparedStatement updateTemplate = conn.prepareStatement(
"UPDATE sis_component_template SET html_template = ? WHERE slug = 'tabbed-livestream'"
);
updateTemplate.setString(1, htmlTemplate);
int rows = updateTemplate.executeUpdate();
System.out.println("Updated " + rows + " row(s).");
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
View File
View File
+22
View File
@@ -0,0 +1,22 @@
CHƯƠNG TRÌNH S.I.S VÌ SỨC KHỎE CỘNG ĐỒNG | Chủ đề: Thoát vị đĩa đệm Khi nào mới phẫu thuật?
Đau lưng, đau cổ, tê tay, tê chân... là những triệu chứng thường gặp của thoát vị đĩa đệm. Tuy nhiên, không phải ai mắc bệnh cũng cần phẫu thuật.
⚠️ Vậy khi nào nên điều trị bảo tồn? Khi nào cần phẫu thuật? Làm sao để tránh bỏ lỡ "thời điểm vàng" điều trị?
Cùng lắng nghe những chia sẻ từ các chuyên gia trong chương trình Livestream "S.I.S vì sức khỏe cộng đồng" vào lúc 𝟏𝟗𝐡𝟒𝟓 Thứ Ba, ngày 𝟎𝟕/𝟎𝟕/𝟐𝟎𝟐𝟔.
📌 Đồng hành và tư vấn trực tiếp cùng quý khán giả là các bác sĩ giàu kinh nghiệm tại Bệnh viện ĐKQT S.I.S Cần Thơ:
• BS.CKI Nguyễn Quang Hưng, chuyên khoa Ngoại Thần kinh
• BS.CKI Trương Đan Kha, chuyên khoa Vật lý trị liệu - Phục hồi chức năng
• ThS.BS Lê Thị Chi Lan, chuyên khoa Ngoại Thần kinh.
Kính mời quý bà con chú ý đón xem livestream tại:
• Fanpage Bệnh viện ĐKQT S.I.S Cần Thơ
• Fanpage S.I.S Charity Foundation (QUỸ TT BNN BỊ ĐQ KV.ĐBSCL)
🎁 Quà tặng đặc biệt: Khán giả đặt câu hỏi giao lưu trực tiếp sẽ có hội nhận Voucher 2 triệu đồng cho các gói khám sức khoẻ tại S.I.S!
======================================
● Để đặt lịch hẹn khám chữa bệnh MIỄN PHÍ:
► https://booking.sisvietnam.vn/booking
Bệnh Viện Đa Khoa Quốc Tế S.I.S Cần Thơ:
🏥 397 Nguyễn Văn Cừ nối dài, P.An Bình, Q.Ninh Kiều, TP. Cần Thơ
---------------------
© Bản quyền thuộc về Bệnh viện Đa khoa Quốc tế S.I.S Cần Thơ
© Copyright by S.I.S Hospital ☞ Do not Reup
+1
View File
@@ -0,0 +1 @@
<iframe width="560" height="315" src="https://www.youtube.com/embed/59I2rL0Ads8?si=3QlUvOdlM6dIX-8S" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

Before

Width:  |  Height:  |  Size: 176 KiB

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

+13
View File
@@ -0,0 +1,13 @@
CHƯƠNG TRÌNH S.I.S VÌ SỨC KHỎE CỘNG ĐỒNG | Chủ đề: Tầm soát và phòng ngừa ung thư gan Chủ động bảo vệ lá gan, bảo vệ sự sống
Ung thư gan là một trong những bệnh ung thư có tỷ lệ tử vong hàng đầu tại Việt Nam. Đáng lo ngại, phần lớn người bệnh chỉ được phát hiện khi bệnh đã ở giai đoạn muộn, khi các cơ hội điều trị hiệu quả đã bị thu hẹp đáng kể.
⚠️ Ai là người có nguy cơ cao mắc ung thư gan? Tầm soát ung thư gan gồm những phương pháp nào? Bao lâu nên kiểm tra một lần để phát hiện bệnh sớm?
Cùng lắng nghe những chia sẻ từ các chuyên gia trong chương trình Livestream "S.I.S vì sức khỏe cộng đồng" vào lúc 𝟏𝟗𝐡𝟒𝟓 Thứ Ba, ngày 𝟑𝟎/𝟎𝟔/𝟐𝟎𝟐𝟔.
📌 Đồng hành và tư vấn trực tiếp cùng quý khán giả là các bác sĩ giàu kinh nghiệm:
• BS.CKII Huỳnh Thị Kim Yến, Nguyên Trưởng bộ môn Nhiễm trường Đại học Y Dược Cần Thơ, Liên chi hội Trưởng Liên Chi hội Truyền nhiễm các tỉnh miền Tây
• BS.CKII Ngô Minh Tuấn, Chuyên khoa CĐHA - Điện quang can thiệp, Bệnh viện ĐKQT S.I.S Cần Thơ
• Ths.BS Lê Xuân Triệu, Chuyên khoa Ung thư, Bệnh viện ĐKQT S.I.S Cần Thơ.
Kính mời quý bà con chú ý đón xem livestream tại:
• Fanpage Bệnh viện ĐKQT S.I.S Cần Thơ
• Fanpage S.I.S Charity Foundation (QUỸ TT BNN BỊ ĐQ KV.ĐBSCL)
🎁 Quà tặng đặc biệt: Khán giả đặt câu hỏi giao lưu trực tiếp sẽ có hội nhận Voucher 2 triệu đồng cho các gói khám sức khoẻ tại S.I.S!
+1
View File
@@ -0,0 +1 @@
<iframe width="560" height="315" src="https://www.youtube.com/embed/xQKA2Z8obUU?si=z7gxT0VTxgrsgvAp" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

+22
View File
@@ -0,0 +1,22 @@
CHƯƠNG TRÌNH S.I.S VÌ SỨC KHỎE CỘNG ĐỒNG| Chủ đề: Cơn đau thắt ngực, khi nào phải đi cấp cứu ngay?
Nhiều người cho rằng đau tức ngực chỉ là do mệt mỏi, stress hay đau bao tử. Thế nhưng, đây cũng có thể là dấu hiệu cảnh báo sớm của nhồi máu cơ tim.
⚠️ Khi nào cơn đau thắt ngực trở thành tín hiệu báo động đỏ? Người bệnh cần xử trí ra sao để tránh những hậu quả đáng tiếc?
Cùng lắng nghe giải đáp từ các chuyên gia trong chương trình Livestream "S.I.S vì sức khỏe cộng đồng" vào lúc 𝟏𝟗𝐡𝟒𝟓 Thứ Ba, ngày 𝟐𝟑/𝟎𝟔/𝟐𝟎𝟐𝟔.
📌 Đồng hành và tư vấn trực tiếp cùng quý khán giả là các bác sĩ giàu kinh nghiệm tại Bệnh viện ĐKQT S.I.S Cần Thơ:
• BS.CKII Huỳnh Quốc Sĩ, Chuyên khoa Nội tổng quát
• BS.CKII Ngô Miên Tường, Chuyên khoa Nội khoa
• BS.CKI Nguyễn Đức Chỉnh, Chuyên khoa Tim mạch can thiệp
Kính mời quý bà con chú ý đón xem livestream tại:
• Fanpage Bệnh viện ĐKQT S.I.S Cần Thơ
• Fanpage S.I.S Charity Foundation (QUỸ TT BNN BỊ ĐQ KV.ĐBSCL)
🎁 Quà tặng đặc biệt: Khán giả đặt câu hỏi giao lưu trực tiếp sẽ có hội nhận Voucher 2 triệu đồng cho các gói khám sức khoẻ tại S.I.S!
======================================
● Để đặt lịch hẹn khám chữa bệnh MIỄN PHÍ:
► https://booking.sisvietnam.vn/booking
Bệnh Viện Đa Khoa Quốc Tế S.I.S Cần Thơ:
🏥 397 Nguyễn Văn Cừ nối dài, P.An Bình, Q.Ninh Kiều, TP. Cần Thơ
---------------------
© Bản quyền thuộc về Bệnh viện Đa khoa Quốc tế S.I.S Cần Thơ
© Copyright by S.I.S Hospital ☞ Do not Reup
+1
View File
@@ -0,0 +1 @@
<iframe width="560" height="315" src="https://www.youtube.com/embed/IZNa1366hyI?si=RNC_6KvSv0Hz1f4j" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

+23
View File
@@ -0,0 +1,23 @@
CHƯƠNG TRÌNH S.I.S VÌ SỨC KHỎE CỘNG ĐỒNG | Chủ đề: Khi bị chấn thương cổ hoặc gãy tay chân - Ta cần làm gì?
Điều phụ huynh mong nhất trong dịp hè là con được vui chơi an toàn. Tuy nhiên, những cú té ngã hay va chạm khi chạy nhảy vẫn có thể xảy ra bất cứ lúc nào.
❓ Khi trẻ bị té ngã, nghi gãy xương hay chấn thương vùng đầu cổ, cần xử trí thế nào?
❓ Những sai lầm nào khi sơ cứu có thể khiến tình trạng nặng hơn?
Trong chương trình livestream "S.I.S vì sức khỏe cộng đồng" vào lúc 𝟏𝟗𝐡𝟒𝟓 Thứ Ba, ngày 𝟏𝟔/𝟎𝟔/𝟐𝟎𝟐𝟔. Các bác sĩ sẽ chia sẻ những kỹ năng sơ cứu cần thiết, giúp phụ huynh bình tĩnh và xử trí đúng khi tai nạn xảy ra.
📌 Đồng hành và tư vấn trực tiếp cùng quý khán giả là:
• BS.CKII Nguyễn Anh Trung, chuyên khoa Chấn thương chỉnh hình - Cơ xương khớp
• Ths.BS Nguyễn Trần Duy, chuyên khoa Chấn thương chỉnh hình - Cơ xương khớp
• ĐD. Trần Minh Kha, khoa Ngoại tổng hợp
Kính mời quý bà con chú ý đón xem livestream tại:
• Fanpage Bệnh viện ĐKQT S.I.S Cần Thơ
• Fanpage S.I.S Charity Foundation (QUỸ TT BNN BỊ ĐQ KV.ĐBSCL)
🎁 Quà tặng đặc biệt: Khán giả đặt câu hỏi giao lưu trực tiếp sẽ có hội nhận Voucher 2 triệu đồng cho các gói khám sức khoẻ tại S.I.S!
======================================
● Để đặt lịch hẹn khám chữa bệnh MIỄN PHÍ:
► https://booking.sisvietnam.vn/booking
Bệnh Viện Đa Khoa Quốc Tế S.I.S Cần Thơ:
🏥 397 Nguyễn Văn Cừ nối dài, P.An Bình, Q.Ninh Kiều, TP. Cần Thơ
---------------------
© Bản quyền thuộc về Bệnh viện Đa khoa Quốc tế S.I.S Cần Thơ
© Copyright by S.I.S Hospital ☞ Do not Reup
+1
View File
@@ -0,0 +1 @@
<iframe width="560" height="315" src="https://www.youtube.com/embed/xlpSK2bp0zQ?si=z8lyaX-anF1EiLMX" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
Binary file not shown.

After

Width:  |  Height:  |  Size: 812 KiB

Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Some files were not shown because too many files have changed in this diff Show More