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.


Getting a php error

Login / Search

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

Well-settled

This is only happening to new user accounts on my site

Here is a screen shot of what I am seeing:



I'm not seeing this in Safari or IE so I'm not quite sure what is wrong. Can anyone help?
Back to the top
 
Posted
Rating:
#103294
Avatar

Well-settled

Correction: This only seems to be happening to a new account I created to test the changes I had been making. I'm going to create another new account to see if it happened again.


Last edit: by Local Mc
Back to the top
 
Posted
Rating:
#103295
Avatar

Well-settled

This error only seems to be happening to new user accounts.

Also, this is only happening to a specific URL which is this: http://www.localmc.com/LocalMC_Community/index.php?page=start

It isn't happening on any other pages.

I'm not sure what to do here. If anyone can help that would be awesome.

- LocalMc


Last edit: by Local Mc
Back to the top
 
Posted
Rating:
#103296
Avatar

Community saint

Local Mc said

This error only seems to be happening to new user accounts.

Also, this is only happening to a specific URL which is this: http://www.localmc.com/LocalMC_Community/index.php?page=start

It isn't happening on any other pages.

I'm not sure what to do here. If anyone can help that would be awesome.

- LocalMc
It looks like the code may be breaking out of the case 'friends': section of the activities.php file (lines 103 to 159) without having set the $where_clause variable. It looks like it would break out of the switch statement (lines 56 to 187) without setting the $where_clause variable, but only if the chat addon wasn't installed or the user wasn't logged in. You could try adding:

Code

$where_clause='';


after the case 'friends': line at line 103 but before the if statement on line 105 of sources_custom/activities.php and see if that takes care of it.
Back to the top
 
Posted
Rating:
#103297
Avatar

Well-settled

Jason,

I added the code to my activities.php file as you suggested and tested it with a new account. The page did open after adding your code fixing the original problem, however I tried adding a friend to the new account and got this error:



Do you have any ideas what happened?


Last edit: by Local Mc
Back to the top
 
Posted
Item has a rating of 5 (Liked by Local Mc)  
Rating:
#103299
Avatar

Community saint

It looks like a possible bug in the query builder around lines 143 to 154. Starting around line 150 you should have:

Code


     if ($where_clause!='')
          $where_clause.=' OR ';
​​​

Try changing that to:

Code


     if ($where_clause!='(')
          $where_clause.=' OR ';
​​​

Changing the $where_clause checking if statement to check for only a single parenthesis instead of checking for blank should fix the extraneous OR in the WHERE clause that is causing that last error.
Back to the top
 
Posted
Rating:
#103300
Avatar

Well-settled

Wow! It looks like that may have fixed my issue. I'm gonna do some more testing but I think this may have done it. Thank you so much Jason for your help. I truly appreciate it.

- Local Mc
Back to the top
 
Posted
Item has a rating of 5 (Liked by Local Mc)  
Rating:
#103301
Avatar

Community saint

Great! Hopefully Chris will check in on this message thread and verify those changes are the correct way to fix those problems.
Back to the top
 
Posted
Rating:
#103302
Avatar

Well-settled

So far my testing is showing no issues but yeah I also hope Chris gets a chance to look this over. Either way you've saved me a lot of headache and I honestly thank you for that :)
Back to the top
 
Posted
Rating:
#103303
Avatar

Well-settled

My original issue is definitely fixed but just in case Chris does get a chance to read this thread I'm now getting a little problem with the main_news block.

If I have the "fall back full" set to more than 1 entry it makes the whole page wonky (for lack of a better term). I do have it working right now cause I have it set for only 1 "fall back full" but maybe Chris our you can help me correct this as well.

Either way thank you again Jason for your help today.
Back to the top
 
Posted
Rating:
#103305
Avatar

Community saint

For the main_news block, I would suspect there is either content (image or video) within one or more of the news articles that is too big and causing a formatting issue or possibly you have some custom CSS or template changes that are affecting the formatting in specific circumstances.

Not digging to deeply into your site, I noticed there are images in the second news article (the Press Release article) that are wide (600 pixels) and the first image is right near the top of the article. The news_main block appears to have a width of 684 pixels, and the member avatar box in the upper right hand corner of the news summary takes up 114 pixels, leaving 570 pixels (not accounting for any margin widths, so probably less than 570 pixels). With that first image in that article being so close to the top of the article and wider than the available 570 pixels of space, that might be an issue? I'm not real fluent in the use of <div> and CSS and I didn't poke around too much at the HTML of the page, so I'm not sure if the <div> blocks that hold the article summary and the member avatar might be fighting for space and overflowing their container which would cause other formatting issues around them. You could test if this is the case by adding height and width parameters to the first image in that article to restrict the width to about 540 pixels (height to about 224 pixels if you want the image look scaled down instead of squished) and see if that helps.

If it is a case of <div> and CSS formatting issues with wide images, I'm sure there is a fairly simple way to get everything to play nicely together without having to go back and change the width of every wide image or video that might cause formatting issues. If you are good with HTML and CSS, you can play around with the code in real-time using the Developer Tools built in to most browsers now. If you use Google Chrome on a Windows PC, press F12 on your messed up page. In the Developers Tool window you should be able to double click on the HTML code to make changes or single click on CSS properties to change make changes. The browser window will update to reflect the changes you make in real-time. Once you find out what needs to be changed, you'll need to find the CSS or template file that contains that code and make the change there.

I could take a look at it, but you'll either need to mess up your news page for a short time or you can create a test copy of your news page. If you mess up your news page, post a message back here when you do and I'll take a quick look so you don't have your page messed up for too long. Or if you create a test copy of your news page, make it guest accessible and not linked to any of your menus, set the main_news block with the parameters needed to mess up the page, and private message me the link and I'll poke around at to see if I can figure anything out.
Back to the top
 
Posted
Rating:
#103306
Avatar

Thanks very much Jason, I agree with your fixes :).

@Local Mc, perhaps if you make a new test page with the block in it's "wonky" state to show us. I guess it's some kind of CSS problem.


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:
#103307
Avatar

Well-settled

Here is a URL with the main_news block set to have 3 articles in the fall back full set up. Let me know if this helps at all:

LocalMC Member News - The LocalMC
Back to the top
 
Posted
Rating:
#103308
Avatar

Community saint

That is rather wonky. It looks like the block contents got partially turned inside out or upside down. Based on the looks of it, it doesn't look like a wide image problem and probably not a CSS formatting problem since the actual structure of the HTML for the page is consistent with the order things actually appear on the page, so something is causing parts of the content to render out of order.

I'm at a loss on this one. If it's not a uniquely specific bug in main_news.php that you've run in to, then I'd say possibly an error in the code used on the comcode page (in the page editor for that page) or an error in one of the templates used to make up the page. What are the values for all of the parameters you are using for the main_news block?
Back to the top
 
Posted
Rating:
#103309
Avatar

Well-settled

This happened after I added the code you provided to the activities.css. Could that have something to do with the wonkyness?
Back to the top
 
Posted
Rating:
#103310
Avatar

I think it is probably something to do with the HTML truncater used to auto-create summaries, I'm going to run some tests when I get the time.


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:
#103311
Avatar

Well-settled

Thank you Chris. I appreciate your's and Jason's help very much.
Back to the top
 
Posted
Rating:
#103323
Avatar

Community saint

Comparing the wonky vs. the non-wonky page, it looks like the <table> the main_news block is embedded in is somehow getting mangled. It does appear to be happening right around the part in NEWS_BOX.tpl where the summary truncation happens, but I'm not sure exactly how that alone would result in the remaining content of the main_news template to be placed outside of the news <section> in added table rows and even outside and above the <table> the block is embedded in. Seems like there could be something unique to the content in the comcode page or in the third news article that might be causing the page to render so oddly or some customisation in one of the news templates? The only other peculiar thing I noticed was that the wonky page truncated the third news article at the word 'Everyone' and on my test site I placed the HTML source of the article in a test news article and it truncated three words later at 'supported'. If the template hasn't been customised, could that be an indication there is extraneous HTML in the beginning of that news article causing the <table> to be corrupted?

I haven't been able to replicate any kind of wonkiness with the main_news block. If I had the full source for the comcode page, the full source for the third article (Ringing in the new year), and a copy of any customised news templates (NEWS_BOX.tpl, NEWS_BRIEF.tpl, and BLOCK_NEWS_MAIN.tpl), I can test further to see if I can replicate.
Back to the top
 
Posted
Rating:
#103339
Avatar

Hi,

Running some tests now…


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:
#103340
Avatar

Ok technical info for Jason's interest…

The surrounding Comcode page context is that of a table. The news post causing the issue has a table. The truncator seems to be grabbing a <tr> without surrounding <table> context, which forces the browser to reassociate it with the Comcode page's table context. Intermediate HTML before/after this fresh tr block is now considered misplaced and shifted out of the table context.


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
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Expand