Hoi
Ik ben bezig met een @mentions scriptje. Ik heb nu dit:
Als ik dit typ: "@Saliox hoi" dan geeft hij alleen dit weer bij posten: "@Saliox".
Hij moet ook "hoi" erachter weergeven. Dus dat betekend dat er hier $mentedAchter = ; iets moet komen waarbij hij bij $mentedtekst de @saliox weghaalt. Dus dat ik hier $output .= $mentionsplit[$j] . .$mentedAchter. "@saliox hoi" uitkrijg.
Beloning 0.48!
Ik ben bezig met een @mentions scriptje. Ik heb nu dit:
function getMentions($mentedText){
$mainArray = explode(@, $mentedText);
$mentedAchter = ;
$numMentions = count($mainArray) - 1;
$output = $mainArray[0];
$queryUsernames = mysql_query("SELECT naam FROM
leden");
$usernames = array();
while($row = mysql_fetch_array($queryUsernames)){
$usernames[] = $row[naam];
}
for($i = 1; $i <= $numMentions; $i++){
$mentionSplit = explode( , $mainArray[$i]);
if(in_arrayi($mentionSplit[0], $usernames)){
$output .= @<a href="/p/.$mentionSplit[0].">.
$mentionSplit[0].</a> .$mentedAchter. ;
}else{
$output .= @.$mentionSplit[0]. ;
}
for($j = 1; $j <= count($mentionSplit); $j++){
$output .= $mentionsplit[$j] . .$mentedAchter.
;
}
}
return($output);
} Als ik dit typ: "@Saliox hoi" dan geeft hij alleen dit weer bij posten: "@Saliox".
Hij moet ook "hoi" erachter weergeven. Dus dat betekend dat er hier $mentedAchter = ; iets moet komen waarbij hij bij $mentedtekst de @saliox weghaalt. Dus dat ik hier $output .= $mentionsplit[$j] . .$mentedAchter. "@saliox hoi" uitkrijg.
Beloning 0.48!