Autor Tema: awards mod  (Leído 593 veces)

Desconectado Lunyx

  • PHPer@
  • **
  • Mensajes: 54
  • Karma: 4
    • Ver Perfil
awards mod
« en: 17 de Noviembre de 2007, 18:14:08 pm »
he instalado este mod en un foro y esta todo bien pero cuando le doy a

View member's badge album.  o a

me sale este error


Fatal error: Call to undefined function awards() in /www/sites/1/iespana.es/l/u/lunyx4/site/Sources/Profile.php on line 317

que puede ser

alguien que tenga ese md instalado en su foro me puede pasar el profile ???

o ayudarme con esto




Comunidad PHPeros

awards mod
« en: 17 de Noviembre de 2007, 18:14:08 pm »

Desconectado Frank005

  • PHPero Experto
  • *****
  • Mensajes: 580
  • Karma: 3
  • Sexo: Masculino
    • Ver Perfil
Re: awards mod
« Respuesta #1 en: 17 de Noviembre de 2007, 18:16:19 pm »
El hosting tendría la funcion awards() activada ??

Desconectado Lunyx

  • PHPer@
  • **
  • Mensajes: 54
  • Karma: 4
    • Ver Perfil
Re: awards mod
« Respuesta #2 en: 17 de Noviembre de 2007, 18:29:19 pm »
esa no es una funcion del host

esa es hecha mira el codigo

Código: [Seleccionar]
function awards($memID)
{
global $context, $db_prefix, $txt, $scripturl, $modSettings, $settings;

// Load language
loadLanguage('ManageAwards');

// Count the number of items in the database for create index
$request = db_query("
SELECT COUNT(*)
FROM {$db_prefix}awards_members
WHERE ID_MEMBER = $memID", __FILE__, __LINE__);
list ($countAM) = mysql_fetch_row($request);
mysql_free_result($request);

// The count of awards per member
$context['countAwards'] = $countAM;

// Calculate the number of results to pull up.
$maxAwards = $modSettings['pa_columns'] * $modSettings['pa_rows'];

// Construct the page index
$context['page_index'] = constructPageIndex($scripturl . '?action=profile;sa=awards;u=' . $memID, $_REQUEST['start'], $countAM, $maxAwards);
$context['start'] = isset($_REQUEST['start']) ? (int) $_REQUEST['start'] : 0;

// Load the awards
$awardsSelect = db_query("
SELECT
aw.ID_AWARD, aw.awardName, aw.gameName, aw.filename, aw.width, aw.height,
am.ID_MEMBER, am.dateReceived, am.favorite
FROM {$db_prefix}awards AS aw
LEFT JOIN {$db_prefix}awards_members AS am ON (am.ID_AWARD = aw.ID_AWARD)
WHERE am.ID_MEMBER = $memID
ORDER BY am.favorite DESC, am.dateReceived DESC
LIMIT $context[start], $maxAwards", __FILE__, __LINE__);

// Set the $context['awards'] var
$context['awards'] = array();

// Fetch the award info just once
while ($row = mysql_fetch_assoc($awardsSelect))
{
$context['awards'][$row['ID_AWARD']] = array(
'id' => $row['ID_AWARD'],
'awardName' => $row['awardName'],
'gameName' => $row['gameName'],
'more' => $scripturl . '?action=profile;sa=awardsMembers;id=' . $row['ID_AWARD'],
'favorite' => array(
'fav' => $row['favorite'],
'href' => $scripturl . '?action=profile;sa=awards;id=' . $row['ID_AWARD'] . ';makeFavorite=' . ($row['favorite'] == 1 ? '0' : '1') . (isset($_REQUEST['u']) ? ';u=' . $_REQUEST['u'] : ''),
'img' => '<img src="' . $settings['images_url'] . '/' . ($row['favorite'] == 1 ? 'collapse' : 'expand') . '.gif" alt="' . $txt['pa_favorite'] . '" />',
),
'filename' => $row['filename'],
'width' => $row['width'],
'height' => $row['height'],
'time' => list ($year, $month, $day) = sscanf($row['dateReceived'], '%d-%d-%d'),
'img' => dirname($scripturl) . '/' . $modSettings['pa_awardsDir'] . '/' . $row['filename'],
);
}
mysql_free_result($awardsSelect);

// Do they want to make this a favorite?
if (isset($_REQUEST['makeFavorite']) && allowedTo(array('profile_extra_any', 'profile_extra_own')))
{
// Check session
checkSession('get');

// memberID
$memberID = (int) $_REQUEST['u'];

// Do they only allow one fav?
if (empty($modSettings['pa_favorite']))
db_query("
UPDATE {$db_prefix}awards_members
SET favorite = 0
WHERE ID_MEMBER = $memberID", __FILE__, __LINE__);

// Now make this one a fav.
db_query("
UPDATE {$db_prefix}awards_members
SET favorite = $_REQUEST[makeFavorite]
WHERE ID_AWARD_MEMBER = " . $_REQUEST['id'] . '000' . $memberID . "
LIMIT 1", __FILE__, __LINE__);

// To make changes appear redirect back to that page
redirectexit('action=profile;sa=awards;u=' . $memID);
}

// Set the title and lost the language file.
$context['page_title'] = $txt[79] . ' - ' . $txt['pa_title'];
$context['sub_template'] = 'awards';

}

function awardsMembers()
{
global $context, $db_prefix, $modSettings, $scripturl, $txt;

// Load language
loadLanguage('ManageAwards');

// An award must be selected.
if (!isset($_REQUEST['id']))
fatal_lang_error('pa_error_no_award');

// Now load the info.
$membersSelect = db_query("
SELECT
mem.realName, am.ID_MEMBER, am.dateReceived
FROM {$db_prefix}awards_members AS am
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = am.ID_MEMBER)
WHERE am.ID_AWARD = $_REQUEST[id]", __FILE__, __LINE__);

// Load the award info separatly
$awardSelect = db_query("
SELECT aw.ID_AWARD, aw.awardName, aw.gameName, aw.filename
FROM {$db_prefix}awards AS aw
WHERE aw.ID_AWARD = $_REQUEST[id]", __FILE__, __LINE__);

$assignedAward = array();

// Fetch the award info just once
$row = mysql_fetch_assoc($awardSelect);
$assignedAward = array(
'id' => $row['ID_AWARD'],
'awardName' => $row['awardName'],
'gameName' => $row['gameName'],
'filename' => $row['filename'],
'img' => dirname($scripturl) . '/' . $modSettings['pa_awardsDir'] . '/' . $row['filename'],
);
mysql_free_result($awardSelect);

// Check if ths award actually exists
if (empty($assignedAward['id']))
fatal_lang_error('pa_error_no_award');

// Set the assignedMembers
$assignedMembers = array();

while ($row = mysql_fetch_assoc($membersSelect))
{
$assignedMembers[] = array(
'id' => $row['ID_MEMBER'],
'name' => $row['realName'],
'date' => $row['dateReceived'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>',
);
}
mysql_free_result($membersSelect);

// Set the context values
$context['assignedAward'] = $assignedAward;
$context['assignedMembers'] = $assignedMembers;
$context['page_title'] = $txt['awards'] . ' - ' . $assignedAward['awardName'];
$context['sub_template'] = 'awards_members';

}