Hallo, heb een site en wil dat leden social media icons op hun profiel kunnen toevoegen.
Alleen het probleem is het werkt wel maar de afbeeldingen van facebook enzo die zijn zichtbaar als ze iets hebben ingevuld maar ook als ze niks hebben ingevuld dan linkt ie gewoon naar me homepage.
Maar ik wil dat als leden niks in hebben gevuld de afbeeldingen ook niet zichtbaar zijn. Dus dat alleen de ingevulde media te zien zijn op profiel.
Maar ik krijg dit niet voor elkaar. Wie iemand hoe dit moet?
Social media
-
-
-
Misschien handig om de code even online te zetten?
-
Doe een check bij het uitprinten dat link niet leeg is?
-
-
Is gelukt thanx.:D
-
Heb je mijn script geprobeerd? Natuurlijk aanpassen naar je eigen wensen
-
Nogmaals bedankt.
-
Probeer het is zo?
PHP
Toon Meer$ctext .= ' <h1 class="contentTitle">'.uitvoer($profiel['username']).' » Social Media</h1> <div class="contentText"> <table> <tr> <td> if($profiel['userFacebook'] == "") { echo ""; } else { echo"<a href='".uitvoer(nl2br($profiel['userFacebook']))."' target='_blank'><img src='images/social-media/facebook.png' alt='Facebook' /></a>"; } if($profiel['userHyves'] == "") { echo ""; } else { echo"<a href='".uitvoer(nl2br($profiel['userHyves']))."' target='_blank'><img src='images/social-media/hyves.png' alt='Hyves' /></a>"; } if($profiel['userTwitter'] == "") { echo ""; } else { echo"<a href='".uitvoer(nl2br($profiel['userTwitter']))."' target='_blank'><img src='images/social-media/twitter.png' alt='Twitter' /></a>"; } if($profiel['userYoutube'] == "") { echo ""; } else { echo"<a href='".uitvoer(nl2br($profiel['userYoutube']))."' target='_blank'><img src='images/social-media/youtube.png' alt='Youtube' /></a>"; } if($profiel['userGoogle'] == "") { echo ""; } else { echo"<a href='".uitvoer(nl2br($profiel['userGoogle']))."' target='_blank'><img src='images/social-media/google.png' alt='Google' /></a>"; } </td> </tr> </table> </div>'; if(permission_check($userid, 'extra profiel informatie') === true) { $ctext .= '<h1 class="contentTitle">'.uitvoer($profiel['username']).' » Special for team</h1> <div class="contentText"> <h2> <a href="tPanel/gebruikers/bannen/'.uitvoer($profiel['username']).'/">Banpunten geven</a> </h2> <h2> <a href="tPanel/gebruikers/profiel/'.uitvoer($profiel['username']).'/">Profiel bewerken</a> </h2> <h2>'; $team = '<strong>Notitie over deze gebruiker:</strong><br/>'; $note = ''; $notice_db = connectie()->query("SELECT * FROM users_notice WHERE userID=".uitvoer($profiel['userID']).""); if($notice_db->num_rows == 1) { $notice = $notice_db->fetch_assoc(); $team = '<strong>Notitie over deze gebruiker:</strong> (Laatst gewijzigd door '.userColor($notice['teamID']).' op '.date_formats($notice['datum']).')<br/>'; $note = stripslashes($notice['notice']); } if(isset($_POST['save_notice']) && strlen($_POST['notice']) > 2) { connectie()->query("REPLACE INTO users_notice (userID, notice, teamID, datum) VALUES(".invoer($profiel['userID']).", '".invoer($_POST['notice'])."', ".invoer($sessie['userID']).", NOW())"); $ctext .= '<strong>Notitie is succesvol opgeslagen.</strong><br/>'; } $ctext .= '<form method="post" action=""> '.$team.' <textarea name="notice" cols="90" rows="3">'.uitvoer($note).'</textarea><br/> <input type="submit" name="save_notice" value="opslaan" /> </form>'; $mult_db = connectie()->query("SELECT inlogs.inlogs_ip, inlogs.inlogs_datum, users.username, users.userRegistratiedatum FROM inlogs JOIN users ON(inlogs.inlogs_id=users.userID) WHERE inlogs.inlogs_ip='".uitvoer($profiel['userIP'])."' AND inlogs.inlogs_id !=".uitvoer($profiel['userID']).""); if($mult_db->num_rows > 0) { $ctext .= '<strong>Andere accounts op dit ip:</strong><br/> Opgelet: 2-3 accounts zijn toegestaan per ip, denk bijv. aan scholen met eenzelfde ip. Stuur altijd eerst een DM en zet resultaat in de nota's.<br/><br/>'; while($mult = $mult_db->fetch_assoc()) { $ctext .= '* <strong>'. uitvoer($mult['username']) .'</strong> geregistreerd op: '.date_formats($mult['userRegistratiedatum']).'<br/>'; } } $ctext .= '</h2> </div>'; } if($profiel['userAge'] != '0000-00-00') { $explode = date_notime($profiel['userAge']); $datum = explode("-", $explode); } $leeftijd = ($profiel['userAge'] == '0000-00-00') ? '<em>Niet opgegeven</em>' : $explode .' ('.leeftijd($datum[0],$datum[1],$datum[2]).')'; $woonplaats = ($profiel['userCity'] == "") ? '<em>Niet opgegeven</em>' : uitvoer($profiel['userCity']); $naam = ($profiel['userRealname'] == "") ? '<em>Niet opgegeven</em>' : uitvoer($profiel['userRealname']); /*<h1 class="contentTitle">Social Media</h1> <div class="contentText"> <div id="social-profile"> <a href=""><img src="images/social-icons/facebook.png" alt="Facebook" /></a> <a href=""><img src="images/social-icons/flickr.png" alt="Facebook" /></a> <a href=""><img src="images/social-icons/google.png" alt="Facebook" /></a> <a href=""><img src="images/social-icons/hyves.png" alt="Facebook" /></a> <a href=""><img src="images/social-icons/linkedin.png" alt="Facebook" /></a> <a href=""><img src="images/social-icons/myspace.png" alt="Facebook" /></a> <a href=""><img src="images/social-icons/skype.png" alt="Facebook" /></a> <a href=""><img src="images/social-icons/email.png" alt="Facebook" /></a> <a href=""><img src="images/social-icons/soundcloud.png" alt="Facebook" /></a> <a href=""><img src="images/social-icons/spotify.png" alt="Facebook" /></a> <a href=""><img src="images/social-icons/twitter.png" alt="Facebook" /></a> <a href=""><img src="images/social-icons/vimeo.png" alt="Facebook" /></a> <a href=""><img src="images/social-icons/youtube.png" alt="Facebook" /></a> </div> </div>*/ $ctext .= ' <h1 class="contentTitle">'.uitvoer($profiel['username']).' » Gebruikers informatie</h1> <div class="contentText"> <table> <tr> <td>Naam</td> <td>'.$naam.'</td> </tr> <tr> <td>Woonplaats</td> <td>'.$woonplaats.'</td> </tr> <tr> <td>Geboortedatum</td> <td>'.$leeftijd.'</td> </tr> <tr> <td>Privé bericht</td> <td><a href="user/dm/nieuw/'.uitvoer($profiel['userID']).'/"><em>Stuur Message</em></a></td> </tr> </table> </div>'; } $navBar = '<li>» Profiel</li> <li>» '.uitvoer($profiel['username']).'</li>'; require_once('../_header.php'); echo $ctext; require_once('../_footer.php'); ?>
-
Werkt ook niet.
-
Wat krijg je voor errors? Of wat werkt er niet?
-
Tja, aangezien ik de source natuurlijk het beste ken.
Het gaat om dit stuk:
Code<td> <a href="'.uitvoer(nl2br($profiel['userFacebook'])).'" target="_blank"><img src="images/social-media/facebook.png" alt="Facebook" /></a> <a href="'.uitvoer(nl2br($profiel['userHyves'])).'" target="_blank"><img src="images/social-media/hyves.png" alt="Hyves" /></a> <a href="'.uitvoer(nl2br($profiel['userTwitter'])).'" target="_blank"><img src="images/social-media/twitter.png" alt="Twitter" /></a> <a href="'.uitvoer(nl2br($profiel['userYoutube'])).'" target="_blank"><img src="images/social-media/youtube.png" alt="Youtube" /></a> <a href="'.uitvoer(nl2br($profiel['userGoogle'])).'" target="_blank"><img src="images/social-media/google.png" alt="Google" /></a> </td>
Nu zou ik het zo gedaan hebben
-
Heb ik ook geprobeerd, lukt ook niet. Er staat steeds een error code
dat er een fout zit op line 124 enzo. -
Fijn dat je regel 124 ook post
-
Dat is dus de regel waar het veranderd moet worden.
-
Welke fout?
Wat staat er in regel 174?
Participate now!
Heb je nog geen account? Registreer je nu en word deel van onze community!