From 3f9d35d276b43f15923a7fc717ed7021e3770661 Mon Sep 17 00:00:00 2001
From: Flatlogic Bot
Date: Sat, 28 Feb 2026 23:45:11 +0000
Subject: [PATCH] v72
---
startup_details.php | 107 +++++++++++++++++++++++++++++++++++++++-----
1 file changed, 95 insertions(+), 12 deletions(-)
diff --git a/startup_details.php b/startup_details.php
index 46355d9..402bb53 100644
--- a/startup_details.php
+++ b/startup_details.php
@@ -40,6 +40,11 @@ if (!$isFounder && $startup['status'] === 'private' && !$isInvestor) {
die("You do not have permission to view this profile.");
}
+// Check if following
+$stmt = db()->prepare("SELECT 1 FROM startup_followers WHERE user_id = ? AND startup_id = ?");
+$stmt->execute([$user_id, $startupId]);
+$isFollowing = (bool)$stmt->fetch();
+
// Fetch funding history
$canSeeHistory = $isFounder || $isInvestor;
$fundingHistory = [];
@@ -236,6 +241,33 @@ function getNextDividendInfo($createdAt) {
background-color: rgba(0,0,0,0.9);
backdrop-filter: blur(4px);
}
+
+ .follow-btn {
+ padding: 16px 24px;
+ border-radius: 999px;
+ font-weight: 800;
+ text-transform: uppercase;
+ font-size: 14px;
+ letter-spacing: 0.5px;
+ cursor: pointer;
+ transition: all 0.3s;
+ display: inline-flex;
+ align-items: center;
+ gap: 10px;
+ border: 1px solid var(--accent-primary);
+ }
+ .follow-btn.following {
+ background: var(--accent-primary);
+ color: #000;
+ }
+ .follow-btn.not-following {
+ background: transparent;
+ color: var(--accent-primary);
+ }
+ .follow-btn:hover {
+ transform: translateY(-2px);
+ box-shadow: 0 4px 15px rgba(0, 255, 128, 0.2);
+ }
@@ -293,6 +325,9 @@ function getNextDividendInfo($createdAt) {
= htmlspecialchars($startup['country']) ?>
+
+ = number_format($startup['followers_count']) ?> Followers
+
= htmlspecialchars($startup['name']) ?>
@@ -302,20 +337,27 @@ function getNextDividendInfo($createdAt) {
-
-
-
- Edit Profile
-
-
@@ -639,6 +681,47 @@ window.onclick = function(event) {
closeWalletModal();
}
}
+
+function toggleFollow(startupId) {
+ const btn = document.getElementById('main-follow-btn');
+ const icon = btn.querySelector('i');
+ const span = btn.querySelector('span');
+ const countSpan = document.getElementById('follower-count');
+
+ fetch('api/follow_startup.php', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ },
+ body: 'startup_id=' + startupId
+ })
+ .then(response => response.json())
+ .then(data => {
+ if (data.success) {
+ if (data.action === 'followed') {
+ btn.classList.remove('not-following');
+ btn.classList.add('following');
+ icon.classList.remove('fa-plus');
+ icon.classList.add('fa-check');
+ span.innerText = 'Following';
+ } else {
+ btn.classList.remove('following');
+ btn.classList.add('not-following');
+ icon.classList.remove('fa-check');
+ icon.classList.add('fa-plus');
+ span.innerText = 'Follow';
+ }
+ if (countSpan) {
+ countSpan.innerText = data.followers_count.toLocaleString();
+ }
+ } else {
+ alert('Error: ' + data.error);
+ }
+ })
+ .catch(error => {
+ console.error('Error:', error);
+ });
+}