HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


v2.6.2 - main_forum_news Block and IPB2 shenanigans...

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#19372 (In Topic #4495)
Avatar

Well-settled

Hi there

Just (finally) upgraded a much modified ocPortal installation to 2.6.2 from 2.1.6 with a complete design overhaul, and everything's worked out fine apart from one thing:

Every so often, a news article called in via main_forum_news block doesn't show thumbnails, but rather the word "Thumbnails".

For an example, check out StrategyCore.co.uk - Core Games for Strategy Gamers and about the 7th news article down the page - "New UFO: Afterlight screens online". As you can see there's three "Thumbnails" bits of text instead of the actual thumbnails.

It just seems to happen every so often for no reason. Here's the code for that news post and the news post above it that works fine:

Code

Over at Cenega Publishing's [url=http://www.cenega.com/index.php?shgame=23]official site[/url] for UFO: Afterlight, five new images are now online and available for perusal. The main Martian base and the red planet being the main attractions, alongside two screenshots where alternate vision modes appear to be in effect.

Here's a taste:

[center][attachmentid=1011] [attachmentid=1012] [attachmentid=1013][/center]

and now the working one…

Code

Michal Dolezal, managing developer at Chaos Concept, sent over 3 new UFO:Extraterrestrials screenshots for us to enjoy. The first one shows a couple of Sneakers caught in an unfortunate situation. The second shows the 3rd largest two floor alien vessel in the game called a Battlecruiser. The last one shows an unfortunate lone soldier facing several sorts of aliens in the underground. You can read more about UFO:Extraterrestrials in our [url=http://www.strategycore.co.uk/pg/ufoet]projects section[/url] as well as at the [url=http://www.ufo-extraterrestrials.com/]official site[/url].

[center][attachmentid=1008] [attachmentid=1009] [attachmentid=1010][/center]

Weird huh? O_o

 The Last Outpost - Entertainment news, reviews, previews & interviews. No holds barred - big boys' language in use!

Back to the top
 
Posted
Rating:
#19374
Avatar

Get rid of the call to 'xhtmlise_html' on line 339 of sources/forum/ipb2.php.

i.e.

Code

            $out[$i]['firstpost']=comcode_to_tempcode(xhtmlise_html($post),$r['starter_id'],false,60,NULL,NULL,false,false,true); // Assumes HTML for posts

to:

Code

            $out[$i]['firstpost']=comcode_to_tempcode($post,$r['starter_id'],false,60,NULL,NULL,false,false,true); // Assumes HTML for posts


The code tries to make sure bad HTML isn't put inside the ocPortal clean XHTML, but it looks like there are full-blown HTML errors coming from IPB2 and hence ocPortal's tidying up gets confused.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#19390
Avatar

Well-settled

That didn't seem to work :(

I viewed the code source though for the news page generated and every so often it does this:

Code

<a href=&quot;Link&quot;

instead of:

Code

<a href="Link"

Most odd. Also, when parsed it seems to output the entire post on one line…?

 The Last Outpost - Entertainment news, reviews, previews & interviews. No holds barred - big boys' language in use!

Back to the top
 
Posted
Rating:
#19401
Avatar

Sorry for the delay in my reply - I was having a protracted argument with a Linux server.

You need to make the same change in sources/blocks/main_forum_news.php.


On one line of HTML, or are line breaks visually missing? If it's one line of HTML then that's probably just how IPB stores posts. I couldn't see a further visual problem on your site.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#19434
Avatar

Well-settled

Removed both and it still happens to random posts :(

 The Last Outpost - Entertainment news, reviews, previews & interviews. No holds barred - big boys' language in use!

Back to the top
 
Posted
Rating:
#19452
Avatar

Did you empty the block cache? If that fails you can send the plain-db-data for one of the offending posts to me and I'll try it out.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#19606
Avatar

Well-settled

Emptying it didn't work :(

Here's the DB entry for one of the posts:

Code

Over at Cenega Publishing&#39;s <a href="http://www.cenega.com/index.php?shgame=23" target="_blank">official site</a> for UFO: Afterlight, five new images are now online and available for perusal. The main Martian base and the red planet being the main attractions, alongside two screenshots where alternate vision modes appear to be in effect.<br /><br />Here&#39;s a taste:<br /><br /><div align="center">[attachmentid=1011] [attachmentid=1012] [attachmentid=1013]</div>

It's the second news article on this page: StrategyCore.co.uk - The UFO Series

 The Last Outpost - Entertainment news, reviews, previews & interviews. No holds barred - big boys' language in use!

Back to the top
 
Posted
Rating:
#19607
Avatar

Right, I was wrong with the initial diagnosis, so I apologise for that.
What is actually happening here is to do with Comcode security. IPB2 stores posts as HTML, but it also throws in BBCode tags. ocPortal can handle this - it treats it all as "semi-html Comcode", which is effectively ocPortal's equivalent of the same thing.
However, I think the poster of this topic doesn't have "Dangerous Comcode" permission, which causes aspects of the post to not be treated as raw-HTML, for security reasons.

Because this is a fairly serious compatibility issue, I'm going to treat it as a bug and therefore have carefully considered a secure fix.
Change line 809 of sources/comcode.php from:

Code

                        if ((!$in_separate_parse_section) && ((!$in_semihtml) || (!$comcode_dangerous))) // Display char. We try and support entities
to:

Code

                        if ((!$in_separate_parse_section) && ((!$in_semihtml) || ((!$comcode_dangerous) && (!$is_all_semihtml)))) // Display char. We try and support entities


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#19610
Avatar

Well-settled

Ah, it'll be one of those IPB "features" where forum administrators can post HTML. I think what's happening though is that even though they're not actually posting HTML, IPB is checking the permissions and saving it as such :)

I'll check this out and let you know if it works.

Cheers Chris.

EDIT: Works perfectly now! Cheers for the hard work :)

On a side note, y'know the reply button disappears if your post is the last post in a topic? In a future version of OCF, I think it would be more intuitive to have an Amend Post button in it's place, since that's the first place you look when wanting to add a little extra info, and it takes extra seconds to find the Edit button (or like me get totally conused and wonder if something's broken like I did the first time a few weeks back ;)).



2nd EDIT @ 9.55pm

Looks like the old bug of not picking up every news post is back to haunt me now :( I'd only just noticed, but this news post: New UFO: Afterlight screens online - StrategyCore Forums which is on teh forums dated 30th of May isnt showing up on the site homepage here: StrategyCore.co.uk - Core Games for Strategy Gamers, even though others from the same forum are.

Any ideas?


Last edit: by Pete

 The Last Outpost - Entertainment news, reviews, previews & interviews. No holds barred - big boys' language in use!

Back to the top
 
Posted
Rating:
#19611
Avatar

The absence of the button is actually to do with the double post permission. But we've decided that for a future version we're going to make the interface give feedback on that rather than just removing the button entirely.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#19642

Non-joined user

Cheers Chris.

I think you might have been posting at the same time as me though - any ideas on my trouble with the point at "Edit 2" in my previous post?
Back to the top
 
Posted
Rating:
#19643
Avatar

I'll take a look at this later today, but if you see this before then, could you remind me what the previous instance of this problem was. A link to a previous topic would help, for example.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#19646
Avatar

Well-settled

It was a while back during 2.1.x I think, but I'll try and find it :)

 The Last Outpost - Entertainment news, reviews, previews & interviews. No holds barred - big boys' language in use!

Back to the top
 
Posted
Rating:
#19649
Avatar

I've found it, and I believe that's a separate problem.

This time, I think it's because the topic ordering is by last-post-date, not topic-date.
You can change that by editing sources/forum/ipb2.php line 287 to say:

Code

      $rows=$this->connection->query('SELECT * FROM '.$this->connection->get_table_prefix().'topics WHERE ('.$id_list.') '.$topic_filter.' ORDER BY start_date DESC',$limit);
instead of:

Code

      $rows=$this->connection->query('SELECT * FROM '.$this->connection->get_table_prefix().'topics WHERE ('.$id_list.') '.$topic_filter.' ORDER BY last_post DESC',$limit);


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#19652
Avatar

Well-settled

Cheers Chris, that worked.

I vaguely recall there was some similar problem in the main_forum_news block whichi I fixed as news was displaying in the wrong order by last_post date as well. You might want to check it out :)

 The Last Outpost - Entertainment news, reviews, previews & interviews. No holds barred - big boys' language in use!

Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: