I recently found this in holocms
and I noticed that it was kinda similar to ubercms however whenever I try to implement it or should I say replace it , I seem to fail.Code:<?php /*===================================================+ || # HoloCMS - Website and Content Management System |+===================================================+ || # Copyright Ā© 2008 Meth0d. All rights reserved. || # http://www.meth0d.org |+===================================================+ || # HoloCMS is provided "as is" and comes without || # warrenty of any kind. HoloCMS is free software! |+===================================================*/ include('../core.php'); include('../includes/session.php'); $i = 0; $output = "["; $getem = mysql_query("SELECT * FROM messenger_friendships WHERE userid = '".$my_id."' OR friendid = '".$my_id."'") or die(mysql_error()); while ($row = mysql_fetch_assoc($getem)) { $i++; if($row['friendid'] == $my_id){ $friendsql = mysql_query("SELECT * FROM users WHERE id = '".$row['userid']."'"); } else { $friendsql = mysql_query("SELECT * FROM users WHERE id = '".$row['friendid']."'"); } $friendrow = mysql_fetch_assoc($friendsql); $name = $friendrow['name']; $id = $friendrow['id']; $output = $output."{\"id\":".$id.",\"name\":\"".$name."\"},"; } $output = substr_replace($output,"",-1); $output = $output."]"; ?> /*-secure- <?php echo $output; ?> */
This is the code I'm trying to change
Any pro coders could help with converting this?Code:case 'recipients': echo '/*-secure-' . LB; echo '['; $getBuddies = dbquery("SELECT receiver FROM messenger_friendships WHERE sender = '" . USER_ID . "'"); $i = 0; while ($buddy = mysql_fetch_assoc($getBuddies)) { if ($i > 0) { echo ','; } echo '{"id":' . $buddy['receiver'] . ',"name":"' . clean($users->id2name($buddy['receiver'])) . '"}'; $i++; } echo ']'; echo LB . ' */'; break;



Reply With Quote

