Base Directory:
/home/ecedu/public_html/new/Views/layouts
View File: right_sidebar.php
<aside class="col-md-4 widget-area end-sidebar-lg" id="right-sidebar" style="margin-top:0px;">
<div class="sticky">
<!-- 📈 الأكثر قراءة -->
<aside class="widget">
<div class="block-title-4">
<h4 class="h5 title-arrow">
<span><?= htmlspecialchars($L['most_read']) ?></span>
</h4>
</div>
<div class="small-post">
<?php foreach ($mostReadNews as $news):
$tableId1 = $news['table_id'] ?? 1;
echo renderSmallPost($news,$tableId1, $lang, $functions);
endforeach; ?>
</div>
<div class="gap-0"></div>
</aside>
<!-- 🎯 مشاركات وفعاليات -->
<aside class="widget">
<div class="block-title-4">
<h4 class="h5 title-arrow">
<a href='list-news.php?i=11&lang=<?= $lang ?>'>
<span><?= htmlspecialchars($L['education_list']) ?>
</a>
<?= edit_news(7); ?></span>
</h4>
</div>
<div class="big-post">
<?php if (!empty($newsType7)):
echo renderBigPost($newsType7[0],7, $lang, $functions);
endif; ?>
</div>
<div class="small-post">
<?php if (!empty($newsType7) && count($newsType7) > 1):
foreach (array_slice($newsType7, 1) as $news):
echo renderSmallPost($news,7, $lang, $functions);
endforeach;
readMore($newsType7,7, $lang , $L);
endif; ?>
</div>
<div class="gap-0"></div>
</aside>
<!-- 📰 آخر الأخبار -->
<aside class="widget">
<div class="block-title-4">
<h4 class="h5 title-arrow">
<span><?= htmlspecialchars($L['news']) ?></span>
</h4>
</div>
<ul class="list-unstyled border-bottom-last-0 rounded mb-3" style="list-style: none;">
<?php foreach ($lastNews as $index => $news):
$title = getLocalizedTitle($news, $lang); ?>
<li class="d-flex mb-4">
<div class="number-box fw-bold me-3"><?= $index + 1 ?></div>
<div class="title-box flex-grow-1">
<a class="d-block h6 h6-md h5-lg" href="article.php?id=<?= $news['news_id'] ?>&type=<?= $type ?>&lang=<?= $lang ?>">
<?= htmlspecialchars($title) ?>
</a>
</div>
</li>
<?php endforeach; ?>
</ul>
<div class="gap-0"></div>
</aside>
<!-- 🌐 الشبكات الاجتماعية -->
<aside class="widget widget_categories widget_categories_custom">
<div class="block-title-4">
<h4 class="h5 title-arrow">
<span><?= htmlspecialchars($L['social_networks']) ?><?= edit_social(); ?></span>
</h4>
</div>
<ul class="list-unstyled social-one">
<?php foreach ($socialPlatforms as $platform):
if (!empty($platform['url'])):
$name = htmlspecialchars($platform['name']);
$url = htmlspecialchars($platform['url']);
$icon = htmlspecialchars($platform['icon']); ?>
<li class="<?= $icon ?>">
<a class="bg-<?= $icon ?> text-white" rel="noopener" href="<?= $url ?>" target="_blank" title="<?= $name ?>">
<?= $name ?>
</a>
</li>
<?php endif; endforeach; ?>
</ul>
<div class="gap-1"></div>
</aside>
<!-- 📢 إعلانات -->
<aside class="widget">
<div class="hover-a text-center">
<div class="py-2">
<span class="text-mute small">- <?= htmlspecialchars($L['ads']) ?> - <?= edit_ads(); ?></span>
</div>
<a href="<?= $ads_url1 ?>" onclick="event.preventDefault();">
<?php if (!empty($ads_img1)): ?>
<img class="img-fluid bg-light" src="<?= $ads_img1 ?>" alt="<?= htmlspecialchars($L['ads']) ?>">
<?php endif; ?>
</a>
</div>
<div class="gap-5"></div>
</aside>
</div>
</aside>