Hello,
i have a table that shows users only if I, as Administrator, want to be shown. But its showing just 1 user and i want to show at least 4. If i copy the code, or use loop, its showing the same user 4 times... How to make it show 4 different users? I tried with "LIMIT 1" changed to LIMIT 4, but nothing happens.
Here are the codes:
PHP code
Code: <?php
////////GET LANG IDS
$aValues = array();
$sSql = " SELECT
`languagevar_id`,
REPLACE(`defVarName`, 'home.', '') AS `key`
FROM `advFetMem_settings` WHERE `defVarName` LIKE '%home.%' ";
$rResult = mysql_query($sSql);
while( ($aRow=mysql_fetch_assoc($rResult)) )
$aValues[ $aRow['key'] ] = $aRow['languagevar_id'];
$smarty->assign('aCusLang_advFetMem', $aValues);
//GET SETTING
$sql ="SELECT `setting_username` FROM `se_settings` LIMIT 1";
$result = mysql_query($sql);
$aRow = mysql_fetch_assoc($result);
$bUserNames = $aRow['setting_username'] == 1 ? TRUE : FALSE;
$iTime = time();
$sql = "SELECT
`u`.`user_id` AS `userId`
FROM `advFetMem_info` AS `i`
INNER JOIN `se_users` AS `u`
ON `u`.`user_id` = `i`.`userid`
WHERE
'".$iTime."' BETWEEN `i`.`start` AND `i`.`end`
ORDER BY RAND()
LIMIT 1";
$result = mysql_query($sql);
$smarty->assign('aAdvFetMem', FALSE);
if( $aRow = mysql_fetch_assoc($result))
{
$tempUser = new se_user(Array($aRow['userId']));
$tempUser->user_displayname();
$aRow['username'] = $tempUser->user_info['user_displayname'];
$aRow['photo'] = $tempUser->user_photo("./images/nophoto.gif", TRUE);
$smarty->assign('aAdvFetMem', $aRow);
}
?>
TPL code
Code: {* include_advFetMem_home.tpl 2009-07-21 12:57:53 rhutton *}
{if $aAdvFetMem}
<div class='header'>{lang_print id=$aCusLang_advFetMem.featured_member}</div>
<div class='portal_content'>
<table cellpadding='0' cellspacing='0' align='center'>
<tr>
<td class='portal_member' valign="bottom" style="width:50%;">
<a href='./profile.php?user_id={$aAdvFetMem.userId}'>{$aAdvFetMem.username|truncate:15:"...":true}</a><br />
<a href='./profile.php?user_id={$aAdvFetMem.userId}'><img src='{$aAdvFetMem.photo}' class='photo' width='60' height='60' border='0' alt='' /></a><br />
</td>
</tr>
</table>
</div>
<div class='portal_spacer'></div>
{/if}
Thank you!
batch file not building to webapps folder
Hello. I just started running Vista :P and can't seem to get my projects deployed. I found out how to run the .bat file, but my project isn't in the Apache webapps folder. I'm getting an error in
Saas with SAP R/3
hi experts,
Help adding strtolower( to my in_array
strtolower i need to add it to this to work, iuno how.Code: $moderators = array('Admin', 'banana', 'orange');if (in_array("{$_SESSION['user_name']}", $moderators)) print('Found it!');i
Question handling xml data
Hello, I have sucessfull followed this tutorialhttp://www.phpfreaks.com/tutorial/handling-xml-dataand used xpath to find the books I need, here is my codeCode: [Select]<?php// load
php include email form with attachment
I have had no luck with finding a email form all over the Internet for various reasons. Some insecure, some simple, some lack of attachment capability, some use redirect, etc. How does one find the
Character increment
Hi,I am facing a scenario like above,but in my case i want to show up like Col A,Col B etc....The container where i am displaying this is being dynamically generated using jquery.Any help?
serializing objects - loses methods - the point being?
HiI know that serializing an object will lose the methods. But whats the point in that? What if we need the methods . Lets say the serialized string is sent from an external server where the calling
column name cancatenation within PL/SQL
I have a PLSQL store procedure, and the following statement is part of a subquery
! = ''
In the following 'IF' statement if v_ompcat = PU for example then Oracle equates that 'IF' statement to NOT TRUE and skips onto the next 'IF' satement whereas I would have thought that it would have
Send current URL in URL with a $_GET variable problem.
Hello community,I have created a function that gets the current variable of a page, example:current page URL: Code: [Select] http://example.com/activate.php?token=123&code=321Now, I want to