News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Topic Count in Profiles

Started by live627, August 18, 2009, 10:40:38 AM

Previous topic - Next topic

TheListener

Woohoo

Well done bud.

(Paints Ha2 green).

Grey makes ya look old.

live627

Quote from: Brack1 on July 26, 2010, 07:41:58 PM
would having the Ultimate portal mod installed have anyaffect?

No

TheListener

It wasn't until I saw the mod in action that I remembered its job.

;D

Celia N. Foster

When I installed this mod, I got this error:

Template Parse Error!
There was a problem loading the /Themes/default/Profile.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/default/Profile.template.php on line 130

121:       echo '
122:             <dt>', $txt['profile_posts'], ': </dt>
123:             <dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';
124:
125:    echo '
126:             <dt>', $txt['profile_topics_started'], ': </dt>
127:             <dd>', $context['member']['topics'], ' ('. $context['member']['topics_per_day'], ' ', $txt['posts_per_day'], ')</dd>
128:             <dt>', $txt['profile_topics_participated'], ': </dt>
129:

130:    // Only show the email address fully if it's not hidden - and we reveal the email.

131:    if ($context['member']['show_email'] == 'yes')
132:       echo '
133:             <dt>', $txt['email'], ': </dt>
134:             <dd><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $context['member']['id'], '">', $context['member']['email'], '</a></dd>';
---------------

How does one fix this error?

Celia N. Foster

Now I've got the following error:

Parse error: syntax error, unexpected '<' in .../Themes/default/Profile.template.php on line 118

109:    <div id="detailedinfo">
110:       <div class="windowbg2">
111:       <span class="topslice"><span></span></span>
112:       <div class="content">
113:          <dl>';
114:
115:    if ($context['user']['is_owner'] || $context['user']['is_admin'])
116:       echo '
117:             <dt>', $txt['username'],': </dt>';

118:             <dd>', $context['member']['username'], '</dd>';

119:
120:    if (!isset($context['disabled_fields']['topics']))
121:       echo '
122:             <dt>', $txt['profile_posts'], ': </dt>

----------
How does one fix this? Help!

live627

Sorry for the late reply.

Change line 118 to this:

echo '<dd>', $context['member']['username'], '</dd>';

Fisch.666

Hi!

I have the same problem, thanks for your reply. After changing this line i get a new error:


[25-Aug-2010 09:09:01] PHP Parse error:  syntax error, unexpected '>' in Themes/default/Profile.template.php on line 118


Ah, and you forgot to change the version 1.6 to 2.0 in the new package.  :)

Cal O'Shaw

Hello,

Any chance you could put 1.5.4 back on the MOD page?  It looks like MODs such as "OS & Browser Detection" and "Reason for editing MOD" fail to install (or uninstall) because of Db Query changes that they can't recognise.  I tried to uninstall 1.5.4 but Profile.php and ModSettings.php had problems and without having the 1.5.4 version up to parse and then compare, I can't make the changes needed .

We're still on 1.1.11 and will be for a few months after 2.0 goes Golden, which means we're going to be on 1.1.11 for some time longer.  Any help in being able to resolve this, even just putting 1.5.4 back up, would be greatly appreciated.

Grazie,

Cal

DeroZ

smf 2.0.4

install20.xml Modification parse error

ormuz


Deaks

ok sorted, download 2.1a should fix this :)
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

NanoSector

Is there a download link anywhere? :P
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Deaks

~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

ormuz

Quote from: Runic on July 15, 2013, 11:18:57 AM
ok sorted, download 2.1a should fix this :)

that was fast! Thanks

impreza

In my mod does not install properly - defeat the system. Maybe it's other add-ons
Portal ToTemat.pl - treści w postaci artykułów i filmów tematycznych.

Dhayzon

no  works in smf 2.0.7

this code is differente :C

// Otherwise do!
else
{
echo '
<dl class="stats">';

// The labels.
foreach ($context['posts_by_time'] as $time_of_day)
echo '
<dt>', date('g a', mktime($time_of_day['hour'])), '</dt>
<dd class="statsbar">', !empty($time_of_day['posts_percent']) ? '<span class="left"></span><div style="width: ' . $time_of_day['posts_percent'] . 'px;" class="stats_bar"></div><span class="right"></span><span class="righttext">' . $time_of_day['posts_percent'] . '%</span>' : '', '</dd>';
echo '
</dl>';

Goten22

Can you count the number of topics for a specific board?

shadav

 ;D any chance on an update for 2.0.15?

getting three errors, one is simple fix
Add After   ./Sources/Profile-View.php   Test failed
it's looking for all of this just to add after
// Posting activity by time.
$result = $smcFunc['db_query']('user_activity_by_time', '
SELECT
HOUR(FROM_UNIXTIME(poster_time + {int:time_offset})) AS hour,
COUNT(*) AS post_count
FROM {db_prefix}messages
WHERE id_member = {int:current_member}' . ($modSettings['totalMessages'] > 100000 ? '
AND id_topic > {int:top_ten_thousand_topics}' : '') . '
GROUP BY hour',
array(
'current_member' => $memID,
'top_ten_thousand_topics' => $modSettings['totalTopics'] - 10000,
'time_offset' => (($user_info['time_offset'] + $modSettings['time_offset']) * 3600),
)
);
$maxPosts = 0;
$context['posts_by_time'] = array();
while ($row = $smcFunc['db_fetch_assoc']($result))
{
// Cast as an integer to remove the leading 0.
$row['hour'] = (int) $row['hour'];

if ($row['post_count'] > $maxPosts)
$maxPosts = $row['post_count'];

$context['posts_by_time'][$row['hour']] = array(
'hour' => $row['hour'],
'posts_percent' => $row['post_count']
);
}
$smcFunc['db_free_result']($result);

if ($maxPosts > 0)
for ($hour = 0; $hour < 24; $hour++)
{
if (!isset($context['posts_by_time'][$hour]))
$context['posts_by_time'][$hour] = array(
'hour' => $hour,
'posts_percent' => 0,
);
else
$context['posts_by_time'][$hour]['posts_percent'] = round(($context['posts_by_time'][$hour]['posts_percent'] * 100) / $maxPosts);
}

// Put it in the right order.
ksort($context['posts_by_time']);

so simply changed for it to just look for
// Put it in the right order.
ksort($context['posts_by_time']);


Add After   ./Themes/default/Profile.template.php   Test failed
this one I fixed what it was looking for but then got template errors, something about unexpected $context
it wants to find
<dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';
but mine looks like this, i'm sure it's probably something I've installed
<dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>' . (!empty($context['member']['anonymous']) ? '
but when it adds

echo '
', $context['tcip_enabled'] && $context['tcip_show_topic_count'] ? '<dt>'. $txt['profile_topics_started']. ': </dt>
<dd>'. $context['member']['topics']. ' ('. $context['member']['topics_per_day']. ' '. $txt['posts_per_day']. ')</dd>
' : '', $context['tcip_enabled'] && $context['tcip_show_participated_count'] ? '<dt>'. $txt['profile_topics_participated']. ': </dt>
<dd>'. $context['member']['topic_count']. '</dd>' : '', '';

I get template errors

lastly I don't know.....
Replace   ./Themes/default/Profile.template.php   Test failed

instructions are
find
// Otherwise do!
else
{
echo '
<dl class="stats">';

// The labels.
foreach ($context['posts_by_time'] as $time_of_day)
echo '
<dt>', date('g a', mktime($time_of_day['hour'])), '</dt>
<dd class="statsbar">', !empty($time_of_day['posts_percent']) ? '<span class="left"></span><div style="width: ' . $time_of_day['posts_percent'] . 'px;" class="stats_bar"></div><span class="right"></span><span class="righttext">' . $time_of_day['posts_percent'] . '%</span>' : '', '</dd>';
echo '
</dl>';

replace

// Otherwise do!
else
{
echo '
<p align="center"><b>', $txt['tcip_posts'] ,'</b></p>
<dl class="stats">';

// The labels.
foreach ($context['posts_by_time'] as $time_of_day)
echo '
<dt>', date('g a', mktime($time_of_day['hour'])), '</dt>
<dd class="statsbar">', !empty($time_of_day['posts_percent']) ? '<span class="left"></span><div style="width: ' . $time_of_day['posts_percent'] . 'px;" class="stats_bar"></div><span class="right"></span><span class="righttext">' . $time_of_day['posts_percent'] . '%</span>' : '', '</dd>';
echo '
</dl>
<p align="center"><br /><b>', $txt['tcip_topics'] ,'</b></p>
<dl class="stats">';

// The labels.
foreach ($context['topics_by_time'] as $time_of_day)
echo '
<dt>', date('g a', mktime($time_of_day['hour'])), '</dt>
<dd class="statsbar">', !empty($time_of_day['posts_percent']) ? '<span class="left"></span><div style="width: ' . $time_of_day['posts_percent'] . 'px;" class="stats_bar"></div><span class="right"></span><span class="righttext">' . $time_of_day['posts_percent'] . '%</span>' : '', '</dd>';
echo '
</dl>';

I don't have that... I tried to break this apart
find
// Otherwise do!
else
{
echo '

after add
<p align="center"><b>', $txt['tcip_posts'] ,'</b></p>

but i'm not sure about the last part how to edit and add after
my code is
// Otherwise do!
else
{
echo '
<ul class="activity_stats flow_hidden">';

// The labels.
foreach ($context['posts_by_time'] as $time_of_day)
{
echo '
<li', $time_of_day['is_last'] ? ' class="last"' : '', '>
<div class="bar" style="padding-top: ', ((int) (100 - $time_of_day['relative_percent'])), 'px;" title="', sprintf($txt['statPanel_activityTime_posts'], $time_of_day['posts'], $time_of_day['posts_percent']), '">
<div style="height: ', (int) $time_of_day['relative_percent'], 'px;">
<span>', sprintf($txt['statPanel_activityTime_posts'], $time_of_day['posts'], $time_of_day['posts_percent']), '</span>
</div>
</div>
<span class="stats_hour">', $time_of_day['hour_format'], '</span>
</li>';
}

echo '

</ul>';
}

echo '
<span class="clear" />
</div>
<span class="botslice"><span></span></span>
</div>
</div>';


thank you for any help

live627

I have updated this to support SMF 2.1.

Advertisement: