2015-08-28, 07:30 PM
2015-08-30, 01:16 PM
Still looking for help on this one. If for example enter the variable {$history_date} it won't display anything (yes, i've made it so once a user logins, it will insert the date into the database)
I'm clueless.
I'm clueless.
2015-09-02, 10:03 PM
Can you show me the template you're using?
2015-09-02, 10:59 PM
Use usercp_end instead for your hook.
2015-09-03, 12:02 AM
Not sure if the hook matters (I think it's fine), but your code is wrong in several other places:
1. You're selecting only the dateline column in the simple_select() query, yet you're trying to use the lastip column. Both need to be selected.
2. $history_date tries to use undefined $loginhistory, which should be $history like in the loop. And why are you using date() instead of MyBB's my_date()?
Also, (int) casting is more preferred than intval(). Your function name is not really unique and may conflict with other plugins.
1. You're selecting only the dateline column in the simple_select() query, yet you're trying to use the lastip column. Both need to be selected.
2. $history_date tries to use undefined $loginhistory, which should be $history like in the loop. And why are you using date() instead of MyBB's my_date()?
Also, (int) casting is more preferred than intval(). Your function name is not really unique and may conflict with other plugins.
2015-09-03, 06:52 AM
Solve.d
2015-09-03, 06:35 PM
You didn't show the template as someone requested. Can't tell more without it. The loginhistory database structure would help too. Also, where do you insert {$history}? Are you sure it's inserted correctly?
But another mistake I can see is that the loop goes $mybb->settings['showhistory'] times, but the template is called only one time, even if the setting is 0. $history_date gets overwritten several times and the last value is probably used in the template, which is never going to work as supposed to. A template should be concatenated to a variable several times in the loop so that all records will be displayed.
But another mistake I can see is that the loop goes $mybb->settings['showhistory'] times, but the template is called only one time, even if the setting is 0. $history_date gets overwritten several times and the last value is probably used in the template, which is never going to work as supposed to. A template should be concatenated to a variable several times in the loop so that all records will be displayed.
2015-09-03, 07:20 PM
Solved
2015-09-03, 07:51 PM
Does the plugin install without any errors? Never heard of smallintval/bigintval column types in any DB system we support.
And the template logic is wrong as I suspected - you can't loop through several records and output them only once in a template. You need to separate this:
And the template logic is wrong as I suspected - you can't loop through several records and output them only once in a template. You need to separate this:
<tr>
<td class="trow1">{$history_date}</td>
<td class="trow1">{$history['lastip']}</td>
<td class="trow1">{$userinfo['country_name']}</td>
<td class="trow1">{$userinfo['city']}</td>
</tr>
into another template and then concantenate it to a variable each time. Then output that variable in the main template.2015-09-04, 10:48 AM
Solved