prepare( 'SELECT c.*, COALESCE(NULLIF(TRIM(a.cl_auth_user), \'\'), \'Inconnu\') AS cl_sccharacter_creator_name FROM tbl_sccharacters c LEFT JOIN tbl_auth a ON a.cl_auth_id = c.cl_sccharacter_owner_auth_id WHERE c.cl_sccharacter_share_token = :share_token AND c.cl_sccharacter_share_enabled = 1 LIMIT 1' ); $stmt_character->execute(['share_token' => $share_token]); $character = $stmt_character->fetch() ?: null; } if ($character) { sccharacters_reindex_character_items($db, (int) $character['cl_sccharacter_id']); $stmt_items = $db->prepare( "SELECT ci.*, bo.cl_scobjs_name AS cl_sccharacteritem_base_name, bo.cl_scobjs_type AS cl_sccharacteritem_base_type, bo.cl_scobjs_subtype AS cl_sccharacteritem_base_subtype, bo.cl_scobjs_uuid AS cl_sccharacteritem_base_uuid, oo.cl_scobjs_name AS cl_sccharacteritem_custom_name, oo.cl_scobjs_type AS cl_sccharacteritem_custom_type, oo.cl_scobjs_subtype AS cl_sccharacteritem_custom_subtype, oo.cl_scobjs_uuid AS cl_sccharacteritem_custom_uuid FROM tbl_sccharacteritems ci LEFT JOIN tbl_scobjs bo ON bo.cl_scobjs_id = ci.cl_sccharacteritem_scobjs_id LEFT JOIN tbl_scitemcustom co ON co.cl_scitemcustom_id = ci.cl_sccharacteritem_scitemcustom_id LEFT JOIN tbl_scobjs oo ON oo.cl_scobjs_id = co.cl_scitemcustom_obj_id WHERE ci.cl_sccharacteritem_character_id = :character_id ORDER BY ci.cl_sccharacteritem_sort_order ASC, ci.cl_sccharacteritem_id ASC" ); $stmt_items->execute(['character_id' => (int) $character['cl_sccharacter_id']]); $character_items = $stmt_items->fetchAll(); $custom_item_ids = []; foreach ($character_items as $row) { if (($row['cl_sccharacteritem_source'] ?? '') === 'custom' && !empty($row['cl_sccharacteritem_scitemcustom_id'])) { $custom_item_ids[] = (int) $row['cl_sccharacteritem_scitemcustom_id']; } } $custom_item_ids = array_values(array_unique(array_filter($custom_item_ids))); if ($custom_item_ids !== []) { $placeholders = implode(',', array_fill(0, count($custom_item_ids), '?')); $stmt_stats = $db->prepare( "SELECT cs.cl_scitemcustomstat_itemcustom_id, st.cl_scstatsitem_name, st.cl_scstatsitem_unit, cs.cl_scitemcustomstat_sign, cs.cl_scitemcustomstat_value FROM tbl_scitemcustomstat cs INNER JOIN tbl_scstatsitem st ON st.cl_scstatsitem_id = cs.cl_scitemcustomstat_stat_id WHERE cs.cl_scitemcustomstat_itemcustom_id IN ({$placeholders}) ORDER BY st.cl_scstatsitem_name ASC, cs.cl_scitemcustomstat_id ASC" ); $stmt_stats->execute($custom_item_ids); foreach ($stmt_stats->fetchAll() as $stat_row) { $itemcustom_id = (int) $stat_row['cl_scitemcustomstat_itemcustom_id']; if (!isset($custom_stats_by_itemcustom[$itemcustom_id])) { $custom_stats_by_itemcustom[$itemcustom_id] = []; } $custom_stats_by_itemcustom[$itemcustom_id][] = $stat_row; } } } else { http_response_code(404); } $item_category_options = sccharacters_item_category_options(); $character_category_order = $character ? sccharacters_character_category_order($character) : sccharacters_default_category_order(); $character_items_by_category = []; foreach ($character_items as $item_row) { $is_custom = ($item_row['cl_sccharacteritem_source'] ?? '') === 'custom'; $type = $is_custom ? (string) ($item_row['cl_sccharacteritem_custom_type'] ?? '') : (string) ($item_row['cl_sccharacteritem_base_type'] ?? ''); $subtype = $is_custom ? (string) ($item_row['cl_sccharacteritem_custom_subtype'] ?? '') : (string) ($item_row['cl_sccharacteritem_base_subtype'] ?? ''); $category_key = sccharacters_resolve_item_category( (string) ($item_row['cl_sccharacteritem_slot'] ?? ''), $type, $subtype ); if (!isset($character_items_by_category[$category_key])) { $character_items_by_category[$category_key] = []; } $character_items_by_category[$category_key][] = $item_row; } $character_items_by_category = sccharacters_sort_items_by_category_order( $character_items_by_category, $character_category_order ); ?> <?php echo htmlspecialchars($character ? ((string) $character['cl_sccharacter_name'] . ' | Personnage partagé') : 'Personnage introuvable', ENT_QUOTES, 'UTF-8'); ?>

Personnage introuvable

Ce lien public est invalide, désactivé ou n’est plus disponible.

Avatar de <?php echo htmlspecialchars((string) $character['cl_sccharacter_name'], ENT_QUOTES, 'UTF-8'); ?>

Créé par équipement(s)

Ce personnage n’a pas encore d’équipement attribué.

$category_items): ?>

0 ? (int) $item_row['cl_sccharacteritem_quantity'] : null; $title = $quantity !== null ? $quantity . 'x ' . $name : $name; $note = trim((string) ($item_row['cl_sccharacteritem_note'] ?? '')); $stats = $is_custom ? ($custom_stats_by_itemcustom[(int) ($item_row['cl_sccharacteritem_scitemcustom_id'] ?? 0)] ?? []) : []; ?>
Aperçu de <?php echo htmlspecialchars($name, ENT_QUOTES, 'UTF-8'); ?>