News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Profile User Action

Started by Rudolf, November 13, 2006, 05:43:32 PM

Previous topic - Next topic

Kimmie

I attempted to install this mod but received this error:

Execute Modification ./Sources/Profile.php Test failed

I know why its doing it and was hoping someone could help me find a work around for it.

I have the karma description mod installed which also affects the Profile.php file and its conflicting with that one. I went ahead and installed it on a test site that has the karma mod also installed on it just to see what would happen. The result is that this mod just simply doesnt work. No errors or anything in the error log.

Is there something I can alter in the profile.php file to make it work while also keeping the karma mod installed?

Tony Reid

Rudolfs post above also applies to you.
Tony Reid

Rudolf

I would fix the Karma Description mod, because it changes a line in the source wich it really shouldn't.
You can install the mod manually without using the package manager with tthese two steps.

In Profile.php
Code (Search) Select

// They haven't even been registered for a full day!?


Code (Add before) Select

//-Profile User Action MOD- Start
if (allowedTo('who_view'))
{
// Look for people online, provided they don't mind if you see they are.
$request = db_query("
SELECT (UNIX_TIMESTAMP(lo.logTime) - UNIX_TIMESTAMP() + " . time() . ") AS logTime, lo.url,
IFNULL(mem.showOnline, 1) AS showOnline, lo.session
FROM {$db_prefix}log_online AS lo LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = lo.ID_MEMBER)
WHERE lo.ID_MEMBER = $memID " . (!allowedTo('moderate_forum') && $memID != $context['user']['id'] ? " AND IFNULL(mem.showOnline, 1) = 1" : '') . "
LIMIT 1", __FILE__, __LINE__);
$url_data = '';
while ($row = mysql_fetch_assoc($request))
{
$actions = @unserialize($row['url']);
if ($actions === false)
continue;

$context['user_action'] = array(
'showOnline' => $row['showOnline'],
'time' => strtr(timeformat($row['logTime']), array($txt['smf10'] => '', $txt['smf10b'] => '')),
'timestamp' => forum_time(true, $row['logTime']),
'is_hidden' => $row['showOnline'] == 0,
'action' => ''
);
$url_data[0] = array($row['url'],$memID);
}

if (!empty($url_data))
{
require_once($sourcedir.'/Who.php');
      list($context['user_action']['action']) = determineActions($url_data);
}
}
  //-Profile User Action MOD- End


In Profile.template.php
Code (Search) Select
<tr>
<td><b>', $txt['lastLoggedIn'], ': </b></td>
<td>', $context['member']['last_login'], '</td>
</tr>';[/code

Code (Add after) Select

  //-Profile User Action MOD- Start
if (!empty($context['user_action']))
echo '
<tr>
<td><b>', $txt['who_action'], ': </b></td>
<td><span', $context['user_action']['is_hidden'] ? ' style="font-style: italic;"' : '', '>', $context['user_action']['action'],' <span style="white-space: nowrap">(', $context['user_action']['time'], ')</span></span></td>
</tr>';
  //-Profile User Action MOD- End
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

Kimmie

#43
ok I have never done anything manually to a mod before so bare with me...lol


Since the mod is already installed can I just edit those files you mentioned make those changes or do I need to uninlstall the entire mod and use those changes "instead" of installing the mod the normal way through the package manager.

Are those changes what basically is installing the whole mod?


Rudolf

If you have already installed it, then just apply the change in the Profile.php. The Profile.template.php should be already modified.
Check if it's so.
Yes, the mod consists in these two changes only, so technically there's no difference between the automaic install and the manual install of these these two changes.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

Kimmie

ok thanks for the help. I will let you know how it goes :)

Kimmie

#46
Ok I made sure the profile mod wasnt installed and then added both of the above adjustments and it still isnt working. Ive added both those files so you can check it for me.

Rudolf

The template file is not correct. The text gets inserted in a comment block.

It has to be like this:

<td>', $context['member']['last_login'], '</td>
</tr>';
*/
//-Profile User Action MOD- Start
if (!empty($context['user_action']))
echo '
<tr>
<td><b>', $txt['who_action'], ': </b></td>
<td><span', $context['user_action']['is_hidden'] ? ' style="font-style: italic;"' : '', '>', $context['user_action']['action'],' <span style="white-space: nowrap">(', $context['user_action']['time'], ')</span></span></td>
</tr>';
  //-Profile User Action MOD- End

// If karma enabled show the members karma.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

Kimmie

#48
ok sorry.. I thought that the "//" was the code that was used for comments - it looks like the only difference between mine and yours is the */ at the beginning and the */ at the end. I will change that and see if it works.
.
Edit.. I fixed the above and its still not working. I even tried re-copying and pasting all the code in.

I have added the new template file

Coon_Dog

#49
Kimmie do the files you are making your changes in have a ~ like the attached ones?  If so those are backup files you need to edit the files without ~.




I have a small problem.  Could be another mod playing games.

hxxp:wegotmud.com/forum/index.php?action=profile;u=1553 [nonactive] 
8: Undefined offset: 0
File: /homepages/19/d127847727/htdocs/forum/Sources/Profile.php
Line: 1301

This error shows up in error log sometimes 5 times a day.  The forum is pretty active so this is not everytime.  I have tried to recreate but failed.  I have viewed profiles with user on and offline.  The mod works perfect other than this error in log.  When I goto unistall mod it says profile template failed and all the code looks original.  I am not trying to remove just check files.   Both files attached.


SMF 1.1.4

Mods:
1. FlashChat Integration 1.0 
2. E-Arcade 2.4.2 
3. Display Age and Location next to posts 1.0 
4. MySpace Field 2.4 
5. Avatar on Member List 1.0   
6. Custom Profile Field Mod 3.17   
7. Profile User Action 1.1   
8. MySpace BBC Tag 1.0   
9. YouTube BBCode 2.1   
10. Google Video BBC Tag (XHTML Compliant) 1.3
11. RemovePM 1.1.4   
12. Google Member Map 0.1   
13. SMF Trader System 1.1   

Update:  I just made the error happen.  It was when Nothing, or nothing you can see... was showing in users online.  Then I viewed that profile.  Then I refresh and it showed me Nothing, or nothing you can see... in profile.  So it didnt work once then it worked.  I attached a pic of profile when error went down.  I think Im gonna define it Nothing, or nothing you can see... if it is not allready defined.  i guess that will fix it.  Unless someone knows where this error is coming from.

Thanx Todd

Kimmie

#50
ok I have tried and tried and tried to get this to work and it wont. I tried it both ways - installing it and having the test failed on the profile.php and them manually adding the code to that file.. (the result was a syntax error when you clicked on the profile button). Then removed all that and tried manually installing both codes - and all that did was make the text on the profile pages bold...lol.


If I uploaded both those templates could someone possibly add the code for me (since there are only two edits) and let me try that?

Islander_IBG

this mod didnt work for 1.1.4 

:(

goaskanna

Works fine for 1.1.5 default theme :)

Anna

Lum-chan

Works for 1.1.5 with TP 1.05 beta 1 on the Green theme
Lum-chan


Rocks-HD

#54
hey guys

make it in smf 2.0 beta 3.1 public is very simple

find:
Quote<td>', $context['member']['last_login'], '</td>
            </tr>';

Add After:
Quote

  //-Profile User Action MOD- Start
   if (empty($context['user_action']))
      echo    '
            <tr>
               <td><b>Action: </b></td>
               <td><span>', $context[member]['action'], '</span></td>
            </tr>';
  //-Profile User Action MOD- End

If you can't find then loking for: $context['member']['last_login'] and go in the context

the secret here is only this code: ', $context[member]['action'], '

linette97

Great Mod! Works Perfectly on my Dilber MC theme & SMF 1.15.... without modifying anything! Thanks!
Watch Documentaries Online!


Yesterday is history,
Tomorrow is a mystery,
Today is a gift,
That's why it's called the Present.

Marcus Forsberg

Will this work whit 2.x?

And if not, will it do in the future?

ccbtimewiz

#57
Quote from: Rocks-HD on July 16, 2008, 03:52:42 AM
hey guys

make it in smf 2.0 beta 3.1 public is very simple

find:
Quote<td>', $context['member']['last_login'], '</td>
            </tr>';

Add After:
Quote

  //-Profile User Action MOD- Start
   if (empty($context['user_action']))
      echo    '
            <tr>
               <td><b>Action: </b></td>
               <td><span>', $context[member]['action'], '</span></td>
            </tr>';
  //-Profile User Action MOD- End

If you can't find then loking for: $context['member']['last_login'] and go in the context

the secret here is only this code: ', $context[member]['action'], '

That wouden't work. You're calling an index that doesn't exist, using a undefined constant 'member', and checking if the action index is empty (when it should be not empty) in the check statement.

The proper way of doing it is like this:

if( !empty( $context['member']['action'] )
{
echo '
<tr>
<td><strong>Current Action: </strong></td>
<td>', $context['member']['action'], '</td>
</tr>';
}


Sabre™

Quote from: MoreBloodWine on October 10, 2008, 10:52:11 PM
What happened to the originally requested by link that I forget was either on the mod page of first post... This mod was made because of a request of mine.

What does it matter?

Nice little addition to the profile page Rudolf.
Thanks mate :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


MoreBloodWine

Quote from: Sabre™ on October 12, 2008, 12:14:20 AM
Quote from: MoreBloodWine on October 10, 2008, 10:52:11 PM
What happened to the originally requested by link that I forget was either on the mod page of first post... This mod was made because of a request of mine.

What does it matter?

Nice little addition to the profile page Rudolf.
Thanks mate :)
Credit should be given where credit is due, he may have created this but the original ideas was and is mine ;-)
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Advertisement: