Weird Behavior from SMF on our Site...

Started by xiphirx, October 09, 2010, 01:20:12 PM

Previous topic - Next topic

xenovanis

Well, if it is a themeissue, it's best to compare your themefiles with those from a vanilla install. You can use filecompare software, like Notepath++ or Context to compare files. If you need help with that (free or paid) you should post a request in the Help Wanted (not for support) board.

Or, you can setup a testsite with your current files and install the mods one by one, to see if one of those is causing trouble.
"Insanity: doing the same thing over and over again and expecting different results."

xiphirx

Yeah, sounds like a good plan to me, I'll find the differences.

But now that I think about it, the added code for the theme I developed is going to obscure my view of differences since every line will be different from a vanilla install...

I have a feeling I will need to make a totally new theme, redevelop it, then reinstall the mods. I honestly can't think of anything else that would cause my problems...

The only thing I modified is the header and footer functions though... :/

xenovanis

"Insanity: doing the same thing over and over again and expecting different results."

xiphirx

Quote from: xenovanis on October 23, 2010, 05:52:19 PM
Any updates on this, xiphirx?

Yes actually, I'm redeveloping the theme. It's almost done, after that I will re-implement the pages I had and see if I get the same behavior. I've been swamped with college work :(

xenovanis

Good luck with that and college  :)

Please keep us posted.
"Insanity: doing the same thing over and over again and expecting different results."

xiphirx

Ok, the theme is 100% complete, its located here: http://beta.fortheswarm.org/

Now, I can't exactly redevelop the pages that were giving me problems since I don't have the content of the old forum in this forum.

Is there anyway to backup the whole forum structure and settings, delete the current forum, and move this new forum over, and re-apply the settings? I want to keep all of the posts, members, avatars, uploads etc.

xiphirx

Ok, figured out that the weird behavior has nothing to do with the theme.

I am redeveloping the front page, which is a custom action page (?action=home) I edited the massive action array, made the correct files, included SSI.php, used the recent posts function, and every post it returns states that it is a new post, even though I've seen it before...

Here is a var_dump of the recent posts function

array(5) { [0]=> array(12) { ["board"]=> array(4) { ["id"]=> string(1) "1" ["name"]=> string(18) "General Discussion" ["href"]=> string(47) "http://beta.fortheswarm.org/index.php?board=1.0" ["link"]=> string(80) "General Discussion" } ["topic"]=> string(1) "2" ["poster"]=> array(4) { ["id"]=> string(1) "1" ["name"]=> string(7) "xiphirx" ["href"]=> string(56) "http://beta.fortheswarm.org/index.php?action=profile;u=1" ["link"]=> string(78) "xiphirx" } ["subject"]=> string(9) "fsdfsdfsd" ["short_subject"]=> string(9) "fsdfsdfsd" ["preview"]=> string(6) "asdfas" ["time"]=> string(29) "October 29, 2010, 05:45:45 PM" ["timestamp"]=> int(1288392345) ["href"]=> string(64) "http://beta.fortheswarm.org/index.php?topic=2.msg5;topicseen#new" ["link"]=> string(79) "fsdfsdfsd" ["new"]=> bool(true) ["new_from"]=> string(1) "0" } [1]=> array(12) { ["board"]=> array(4) { ["id"]=> string(1) "1" ["name"]=> string(18) "General Discussion" ["href"]=> string(47) "http://beta.fortheswarm.org/index.php?board=1.0" ["link"]=> string(80) "General Discussion" } ["topic"]=> string(1) "1" ["poster"]=> array(4) { ["id"]=> string(1) "1" ["name"]=> string(7) "xiphirx" ["href"]=> string(56) "http://beta.fortheswarm.org/index.php?action=profile;u=1" ["link"]=> string(78) "xiphirx" } ["subject"]=> string(19) "Re: Welcome to SMF!" ["short_subject"]=> string(19) "Re: Welcome to SMF!" ["preview"]=> string(131) "Quote from: Simple Machines on October 26, 2010, 04:47:33 PMWelcome to Simple Machines Forum!We hope you enjoy using your forum...." ["time"]=> string(29) "October 29, 2010, 04:10:46 PM" ["timestamp"]=> int(1288386646) ["href"]=> string(64) "http://beta.fortheswarm.org/index.php?topic=1.msg4;topicseen#new" ["link"]=> string(89) "Re: Welcome to SMF!" ["new"]=> bool(true) ["new_from"]=> string(1) "0" } [2]=> array(12) { ["board"]=> array(4) { ["id"]=> string(1) "1" ["name"]=> string(18) "General Discussion" ["href"]=> string(47) "http://beta.fortheswarm.org/index.php?board=1.0" ["link"]=> string(80) "General Discussion" } ["topic"]=> string(1) "1" ["poster"]=> array(4) { ["id"]=> string(1) "1" ["name"]=> string(7) "xiphirx" ["href"]=> string(56) "http://beta.fortheswarm.org/index.php?action=profile;u=1" ["link"]=> string(78) "xiphirx" } ["subject"]=> string(19) "Re: Welcome to SMF!" ["short_subject"]=> string(19) "Re: Welcome to SMF!" ["preview"]=> string(0) "" ["time"]=> string(29) "October 29, 2010, 04:07:12 PM" ["timestamp"]=> int(1288386432) ["href"]=> string(64) "http://beta.fortheswarm.org/index.php?topic=1.msg3;topicseen#new" ["link"]=> string(89) "Re: Welcome to SMF!" ["new"]=> bool(true) ["new_from"]=> string(1) "0" } [3]=> array(12) { ["board"]=> array(4) { ["id"]=> string(1) "1" ["name"]=> string(18) "General Discussion" ["href"]=> string(47) "http://beta.fortheswarm.org/index.php?board=1.0" ["link"]=> string(80) "General Discussion" } ["topic"]=> string(1) "1" ["poster"]=> array(4) { ["id"]=> string(1) "1" ["name"]=> string(7) "xiphirx" ["href"]=> string(56) "http://beta.fortheswarm.org/index.php?action=profile;u=1" ["link"]=> string(78) "xiphirx" } ["subject"]=> string(19) "Re: Welcome to SMF!" ["short_subject"]=> string(19) "Re: Welcome to SMF!" ["preview"]=> string(18) "I am so lonely :-(" ["time"]=> string(29) "October 29, 2010, 04:06:47 PM" ["timestamp"]=> int(1288386407) ["href"]=> string(64) "http://beta.fortheswarm.org/index.php?topic=1.msg2;topicseen#new" ["link"]=> string(89) "Re: Welcome to SMF!" ["new"]=> bool(true) ["new_from"]=> string(1) "0" } [4]=> array(12) { ["board"]=> array(4) { ["id"]=> string(1) "1" ["name"]=> string(18) "General Discussion" ["href"]=> string(47) "http://beta.fortheswarm.org/index.php?board=1.0" ["link"]=> string(80) "General Discussion" } ["topic"]=> string(1) "1" ["poster"]=> array(4) { ["id"]=> string(1) "0" ["name"]=> string(15) "Simple Machines" ["href"]=> string(0) "" ["link"]=> string(15) "Simple Machines" } ["subject"]=> string(15) "Welcome to SMF!" ["short_subject"]=> string(15) "Welcome to SMF!" ["preview"]=> string(136) "Welcome to Simple Machines Forum!We hope you enjoy using your forum.  If you have any problems, please feel free to ask us for a..." ["time"]=> string(29) "October 26, 2010, 04:47:33 PM" ["timestamp"]=> int(1288129653) ["href"]=> string(64) "http://beta.fortheswarm.org/index.php?topic=1.msg1;topicseen#new" ["link"]=> string(85) "Welcome to SMF!" ["new"]=> bool(true) ["new_from"]=> string(1) "0" } }


Here is my edit to the action array

'home' => array('_Home.php', 'Home'),


Here is _Home.php

<?PHP
if (!defined('SMF'))
die('We would appreciate it if you don\'t try to hack.');

function Home() {
global $context;
$context['page_title'] = 'For The Swarm';
// This is gonna be needed...
loadTemplate('home');
}
?>


Here is home.template.php (empty for now)

<?PHP
function template_main()
{

}
?>


Here is the sidebar source code (look at the bottom for the recent posts code)

<?PHP
require_once("_rsslib.php");
require_once("SSI.php");
echo
'
<div id="sideBody">
<div id="liveStreamContainer">
<img src="Themes/HydraV1/themeImages/liveStreamIcon.gif" alt="LS" title="http://www.livestream.com/ Zerg Streams" style="float: left;"/>
<div style="float: right;">Live Streams</div>
<div class="clear"></div>
<hr class="purple"/>
<div class="liveStream1">
<div class="stream" id="3870x2"><img src="Themes/HydraV1/themeImages/live.gif" alt="LIVE" title="User is Streaming LIVE!" style="float:left;"/></div>
<div style="float:left;color: #666666;margin-left:10px;">Diamond Zerg</div>
<div style="float: right;"><a href="http://www.livestream.com/3870x2/" style="color:#4e6005; border: 0;">TossPro</a></div>
<div class="clear"></div>
</div>
<div class="liveStream2">
<div class="stream" id="illusioncss"><img src="Themes/HydraV1/themeImages/live.gif" alt="LIVE" title="User is Streaming LIVE!" style="float:left;"/></div>
<div style="float:left;color: #666666;margin-left:10px;">Diamond Zerg</div>
<div style="float: right;"><a href="http://www.livestream.com/illusioncss/" style="color:#4e6005; border: 0;">Illusion</a></div>
<div class="clear"></div>
</div>
<div class="liveStream1">
<div class="stream" id="rigid54"><img src="Themes/HydraV1/themeImages/live.gif" alt="LIVE" title="User is Streaming LIVE!" style="float:left;"/></div>
<div style="float:left;color: #666666;margin-left:10px;">Diamond Zerg</div>
<div style="float: right;"><a href="http://www.livestream.com/rigid54/" style="color:#4e6005; border: 0;">Rigid</a></div>
<div class="clear"></div>
</div>
<div class="liveStream2">
<div class="stream" id="zerkerzerg"><img src="Themes/HydraV1/themeImages/live.gif" alt="LIVE" title="User is Streaming LIVE!" style="float:left;"/></div>
<div style="float:left;color: #666666;margin-left:10px;">Diamond Zerg</div>
<div style="float: right;"><a href="http://www.livestream.com/zerkerzerg/" style="color:#4e6005; border: 0;">ZerkerZerg</a></div>
<div class="clear"></div>
</div>
<div class="liveStream1">
<div class="stream" id="turkis873"><img src="Themes/HydraV1/themeImages/live.gif" alt="LIVE" title="User is Streaming LIVE!" style="float:left;"/></div>
<div style="float:left;color: #666666;margin-left:10px;">Diamond Zerg</div>
<div style="float: right;"><a href="http://www.livestream.com/turkis873/" style="color:#4e6005; border: 0;">Turkis</a></div>
<div class="clear"></div>
</div>
<div class="liveStream2">
<div class="stream" id="fedoranimus"><img src="Themes/HydraV1/themeImages/live.gif" alt="LIVE" title="User is Streaming LIVE!" style="float:left;"/></div>
<div style="float:left;color: #666666;margin-left:10px;">Random</div>
<div style="float: right;"><a href="http://www.livestream.com/fedoranimus/" style="color:#4e6005; border: 0;">Fedoranimus</a></div>
<div class="clear"></div>
</div>
<div class="liveStream1">
<div class="stream" id="xiphirx"><img src="Themes/HydraV1/themeImages/live.gif" alt="LIVE" title="User is Streaming LIVE!" style="float:left;"/></div>
<div style="float:left;color: #666666;margin-left:10px;">NoobToss, BroodWar Zerg play, Horror Games</div>
<div style="float: right;"><a href="http://www.livestream.com/xiphirx/" style="color:#4e6005; border: 0;">Xiphirx</a></div>
<div class="clear"></div>
</div>

</div>

<br /><br />

<div id="blizzTrackerContainer">
<img src="Themes/HydraV1/themeImages/blizzIcon.gif" alt="Blizzard" title="http://www.blizzard.com/ Community Tracker" style="float: left;"/>
<div style="float: right;">Blizz Tracker</div>
<div class="clear"></div>
<hr class="blue"/>';
echo RSS_Display("http://beta.fortheswarm.org/Sources/_bluetracker.php", 10);
/*
FORMAT FOR BLIZZ TRACKER DIVS
<div class="blizzTracker1">
Helo
<div class="trackerContent">
Some crap here
</div>
</div>
<div class="blizzTracker2">
Hello
<div class="trackerContent">
Some crap here
</div>
</div>
*/
echo '
</div>

<br /><br />

<div id="replaySpotLightContainer">
<img src="Themes/HydraV1/themeImages/sc2Icon.gif" alt="Blizzard" title="Spotlight of the best replays hosted here at http://fortheswarm.org/" style="float: left;"/>
<div style="float: right;">Replay Spotlight</div>
<div class="clear"></div>
<hr class="purple"/>
<div id="replaySpotLightContent">
<div style="text-align:center;color:#7800de;">
<img src="somemaphere" alt="Map Icon" title="Map the replay was played on" style="border: 1px solid #7e00ff;"/><br />
<br />
<div class="blackAlpha50" style="color:#4e6005;">Burning Sands</div>
<br />
<div class="blackAlpha50">
<img src="Themes/HydraV1/themeImages/raceIcons/zerg.gif" alt="[ZERG]" title="Zerg" style="vertical-align: middle;" />&nbsp;&nbsp;AwesomeZergDude<span style="color:#666666;">#666</span><br />
<span style="color:#4e6005;font-size:170%;">VS</span><br />
<img src="Themes/HydraV1/themeImages/raceIcons/terran.gif" alt="[TERRAN]" title="Terran" style="vertical-align: middle;" />&nbsp;&nbsp;SomeTerranIdiot<span style="color:#666666;">#999</span><br />
<hr class="purple"/>
<div style="float: left;color: #666666;">999,999,999 Comments</div>
<div style="float:right;"><a href="#" title="View and download this replay!">View</a></div>
<div class="clear"></div>
</div>
</div>
</div>
</div>

<br /><br />

<div id="recentForumPostsContainer">
<img src="Themes/HydraV1/themeImages/forumIcon.gif" alt="Forums" title="For The Swarm Forum Recent Posts" style="float: left;"/>
<div style="float: right;">Recent Posts</div>
<div class="clear"></div>
<hr class="purple"/>';
$recentPosts = ssi_recentPosts(10, NULL, 'array');
var_dump($recentPosts);
/*$i = 0;
foreach ($recentPosts as $array)
{
$i++;
echo "<div class='recentForumPost";
        if ($i%2 == 0 ) { echo  '1'; }else{ echo '2';}
        echo "'>";
echo '
<a href="'.$array['href'].'" >';
if ($array['new']==true)
{
echo '<img src="http://beta.fortheswarm.org/forum/Themes/HydraV1/images/english/new.gif" alt="[NEW]" />&nbsp;';
}
echo $array['subject'].'</a>
</div>
';
}*/
/*
<div class="recentForumPost1">
OALSOAGLAKS
</div>
<div class="recentForumPost2">
OALSOAGLAKS
</div>*/
echo '
</div>
</div>
<div class="clear"></div>
';

?>


index.template.php includes sidebar.php based on the action variable.

Is it wrong to include SSI in a custom forum page? Do I need to manually query the database? I'm stuck here :(

xiphirx

Not sure if bumping is allowed... but this is slightly urgent, we're going to make the site live in a few weeks...


Jakob Fel

Bumping is allowed, as long as it is 24 hours away from the last post on the topic. :) We are all volunteers, and we live (mainly) in different timezones, so sorry if it takes a while to get back to you. :) However, I am not sure what to say for your original issue. I just wanted to clarify the bumping question.
Freelance writer and advocate for security, privacy & DRM-free distribution
Support and Community Management at SMFNew Free Forum Hosting

xiphirx

Quote from: Jaekob Caed on November 03, 2010, 07:32:48 PM
Bumping is allowed, as long as it is 24 hours away from the last post on the topic. :) We are all volunteers, and we live (mainly) in different timezones, so sorry if it takes a while to get back to you. :) However, I am not sure what to say for your original issue. I just wanted to clarify the bumping question.

Thanks for the information.

Hopefully I'm wrong about being able to use SSI in SMF pages...

Oya

pretty much the first line in ssi.php is to check if smf is already loaded and do a certain amount of bailing if that's the case...

xiphirx

Quote from: Oya on November 04, 2010, 07:07:24 PM
pretty much the first line in ssi.php is to check if smf is already loaded and do a certain amount of bailing if that's the case...

Then why is the array of recent posts returning everything new?.. :/

Also, would that check work if I included a php script that includes ssi?

xiphirx

Ok, I may have figured out the problem... Not sure how this works, but here goes:

I was looking at the source code to SSI.php, and noticed that it got whether the topic is new or not from the table {prefix}_log_mark_read. I looked at this table in phpMyAdmin, and there is only one entry... (someone other than me)

I'm almost sure it should be much more than one...

Oya

there are multiple tables that deal with whether something has been read or not, specifically log_topics as well

xiphirx

So I have made the new theme live on the site, and now the recent posts section doesn't even show up...

I get


Warning: mysql_query(): 7 is not a valid MySQL-Link resource in /home/forthesw/public_html/forum/Sources/Subs.php on line 321
2: mysql_query(): 7 is not a valid MySQL-Link resource
File: /home/forthesw/public_html/forum/Sources/Subs.php
Line: 321


:|

xenovanis

Moving this to the Coding Discussion board, which seems a more appropriate place.

Free bump included  ;)
"Insanity: doing the same thing over and over again and expecting different results."

xiphirx

Quote from: xenovanis on November 08, 2010, 08:59:47 AM
Moving this to the Coding Discussion board, which seems a more appropriate place.

Free bump included  ;)

Thanks.

I have been tinkering with some things, and I changed the cookie name in the admin panel. It seems like it solved the unread posts / replies issue I was having ... which is very odd...

Anyway, I don't think I'll have custom ?action variables anymore, as they are causing so many weird things to happen. Unless someone can tell me whats happening, I think I may just create a whole independent page, and just use the layering system (now that I think about it, I don't know why I didn't do this before). I scheduled maintenance on the site to be tomorrow, so I'll let you all know if something horrible goes wrong.

xiphirx

Created a new page using SSI's layering system to test. Same problems.

So it's definitely not they way I'm developing the pages... something seriously wrong is going on :|


To reiterate, my main problem right now (I have others) is that ssi_recentForumPosts() is returning that every seen post is new, and every unseen post is not new...

xiphirx

*facepalm*

Right, one of two issues resolved. Turns out that I was making a manual query to the db using the variable $link, and then closing it, while SMF uses the same variable name -_-...

I solved it by not closing it, and just letting SMF take care of it :P

Last problem I have: Unread Posts doesn't show the last posts since your last visit, you have to do a "Show all unread posts" to see the posts...

This has to be a session issue... any thoughts?

Advertisement: