Skip to content

Commit b5f85de

Browse files
committed
Revert "hopefully fix google ad issues"
This reverts commit 5716983.
1 parent 5716983 commit b5f85de

3 files changed

Lines changed: 11 additions & 103 deletions

File tree

public/css/forum.css

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -212,23 +212,3 @@
212212

213213
/* Only keep essential overrides - let Bootstrap handle everything else */
214214

215-
/* Google AdSense Ads Styling */
216-
.adsbygoogle {
217-
min-height: 250px;
218-
background-color: #f8f9fa;
219-
border-radius: 0.375rem;
220-
}
221-
222-
/* Ensure ads are visible immediately */
223-
.card .adsbygoogle {
224-
display: block !important;
225-
margin: 0 auto;
226-
}
227-
228-
/* Responsive ad sizing */
229-
@media (max-width: 991.98px) {
230-
.adsbygoogle {
231-
min-height: 100px;
232-
}
233-
}
234-

public/js/app.js

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,6 @@ class ForumApplication {
364364
// Update main content
365365
document.getElementById('main-content').innerHTML = content;
366366

367-
// Initialize Google AdSense ads after content is loaded
368-
this.initializeAds();
369-
370367
// Update pagination
371368
this.updatePagination(pagination);
372369

@@ -1149,26 +1146,17 @@ class ForumApplication {
11491146

11501147
// WebSocket methods removed - static archive only
11511148

1152-
// Initialize Google AdSense ads
1153-
initializeAds() {
1154-
// Wait for AdSense to be loaded
1155-
if (typeof window.adsbygoogle !== 'undefined') {
1156-
try {
1157-
// Find all ad elements and initialize them
1158-
const adElements = document.querySelectorAll('.adsbygoogle');
1159-
adElements.forEach(ad => {
1160-
if (!ad.hasAttribute('data-adsbygoogle-status')) {
1161-
(window.adsbygoogle = window.adsbygoogle || []).push({});
1162-
}
1163-
});
1164-
console.log('✅ Google AdSense ads initialized');
1165-
} catch (error) {
1166-
console.error('❌ Failed to initialize AdSense ads:', error);
1167-
}
1168-
} else {
1169-
// Retry after a short delay if AdSense isn't loaded yet
1170-
setTimeout(() => this.initializeAds(), 1000);
1171-
}
1149+
// Utility method to get language flag
1150+
getLanguageFlag(language) {
1151+
const flags = {
1152+
'Español': '🇪🇸',
1153+
'English': '🇺🇸',
1154+
'Português': '🇵🇹',
1155+
'Deutsch': '🇩🇪',
1156+
'Français': '🇫🇷',
1157+
'Italiano': '🇮🇹'
1158+
};
1159+
return flags[language] || '🌐';
11721160
}
11731161

11741162
// Expose scroll position management methods

public/js/components.js

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -313,21 +313,6 @@ export function createCategoriesSidebar(categories, selectedCategory = null, pag
313313

314314
let sidebarContent = `
315315
<div class="col-lg-3">
316-
<!-- Google AdSense Sidebar Ad -->
317-
<div class="card mb-4">
318-
<div class="card-body p-2 text-center">
319-
<ins class="adsbygoogle"
320-
style="display:block"
321-
data-ad-client="ca-pub-2117992780566693"
322-
data-ad-slot="YOUR_AD_SLOT_ID"
323-
data-ad-format="auto"
324-
data-full-width-responsive="true"></ins>
325-
<script>
326-
(adsbygoogle = window.adsbygoogle || []).push({});
327-
</script>
328-
</div>
329-
</div>
330-
331316
<div class="card">
332317
<div class="card-header">
333318
<h5 class="mb-0">
@@ -402,21 +387,6 @@ export function createCategoriesSidebar(categories, selectedCategory = null, pag
402387

403388
sidebarContent += `
404389
</div>
405-
406-
<!-- Second Google AdSense Sidebar Ad -->
407-
<div class="card mt-4">
408-
<div class="card-body p-2 text-center">
409-
<ins class="adsbygoogle"
410-
style="display:block"
411-
data-ad-client="ca-pub-2117992780566693"
412-
data-ad-slot="YOUR_AD_SLOT_ID_2"
413-
data-ad-format="auto"
414-
data-full-width-responsive="true"></ins>
415-
<script>
416-
(adsbygoogle = window.adsbygoogle || []).push({});
417-
</script>
418-
</div>
419-
</div>
420390
</div>
421391
`;
422392

@@ -446,21 +416,6 @@ export function createCategoriesSidebarGrouped(allCategories, selectedLanguage =
446416

447417
let sidebarContent = `
448418
<div class="col-lg-3">
449-
<!-- Google AdSense Sidebar Ad -->
450-
<div class="card mb-4">
451-
<div class="card-body p-2 text-center">
452-
<ins class="adsbygoogle"
453-
style="display:block"
454-
data-ad-client="ca-pub-2117992780566693"
455-
data-ad-slot="YOUR_AD_SLOT_ID"
456-
data-ad-format="auto"
457-
data-full-width-responsive="true"></ins>
458-
<script>
459-
(adsbygoogle = window.adsbygoogle || []).push({});
460-
</script>
461-
</div>
462-
</div>
463-
464419
<div class="card">
465420
<div class="card-header">
466421
<h5 class="mb-0">
@@ -508,21 +463,6 @@ export function createCategoriesSidebarGrouped(allCategories, selectedLanguage =
508463
`).join('')}
509464
</div>
510465
</div>
511-
512-
<!-- Second Google AdSense Sidebar Ad -->
513-
<div class="card mt-4">
514-
<div class="card-body p-2 text-center">
515-
<ins class="adsbygoogle"
516-
style="display:block"
517-
data-ad-client="ca-pub-2117992780566693"
518-
data-ad-slot="YOUR_AD_SLOT_ID_2"
519-
data-ad-format="auto"
520-
data-full-width-responsive="true"></ins>
521-
<script>
522-
(adsbygoogle = window.adsbygoogle || []).push({});
523-
</script>
524-
</div>
525-
</div>
526466
</div>
527467
`;
528468

0 commit comments

Comments
 (0)