Advertisement:

Author Topic: <Resolved>Fixing Payment Plugin user-custom.php Issue  (Read 7139 times)

nootkan

  • Sr. Member
  • ****
  • Posts: 259
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #15 on: January 30, 2014, 05:40:21 pm »
@SmaRTeY
I got it solved:
http://forums.osclass.org/plugins-20/payment-plugin-osc_add_route-bug/msg84086/#msg84086

Problem is that older themes do not include user-custom.php file that needs to be created  ;)

Frosticek, that is what I have done, created a user-custom.php file and added the necessary functions to the functions.php file under "New Functions".  But the pages are still not rendering properly.  Because I am not fluent in php I was assuming that it may be something I've copied over from the bender theme functions.php file which is why I attached the two files for all to look over for me.  Did you create the user-custom.php file and it works fine for you?  If so, which theme?  Could you attach your files so I can compare?

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #16 on: January 30, 2014, 11:23:48 pm »
@nootkan
You do not need to create any functions in function.php, only that file.

nootkan

  • Sr. Member
  • ****
  • Posts: 259
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #17 on: January 31, 2014, 06:11:01 am »
That won't work either.  When I first started to figure this out I copied the Bender Theme user-custom.php file without adding the body_class functions to the functions.php file but I got a body_class function error.  After adding the functions I arrived at where I am now.  I get the page to look like the rest of my theme but the divs aren't where they're supposed to be and there is a "A" character just above the header widget. 

I tried to remove all the functions and also the php call to the body_class function in user-custom.php but I still get the same look for some reason.  It looks the same way for both modifications (with or without the functions and call) in all browsers.  I've attached a screenshot.

« Last Edit: January 31, 2014, 06:13:59 am by nootkan »

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #18 on: January 31, 2014, 06:59:23 pm »
Could it be a simple utf8 code failure?  ::)

nootkan

  • Sr. Member
  • ****
  • Posts: 259
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #19 on: February 03, 2014, 07:57:40 pm »
Maybe, I have no idea how to find out if it is or how to fix it.  As I've stated previously I have very little php experience which hinders my ability to resolve this issue I am having with the user-custom.php file.  That is why I wanted to pay someone to do this for me.  Surely there is a way to trouble shoot this problem and resolve it?  I have installed four other responsive themes and made no theme modifications and then created the user-custom.php  file and all four themes provide the same result, an ugly payment/menu page that doesn't render properly.  Yet every other facet of osclass using different themes works fine on my server it seems. 

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #20 on: February 03, 2014, 08:51:29 pm »
Sorry Nootkan, I thought there were others using PayPal and Bender without the div issues thinking we could get it solved here in the forums. I am out of ideas and hope there are others still who can help you.

Regards,
Eric

nootkan

  • Sr. Member
  • ****
  • Posts: 259
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #21 on: February 04, 2014, 12:14:12 am »
Eric, thanks for trying.  I appreciate all you have done to try and help me with this issue.  I too was sure that someone must be using the payment plugin with a custom theme experiencing the same issue.  I find it hard to believe that no one has come up with a solution for this yet. 
« Last Edit: February 04, 2014, 03:42:40 am by nootkan »

tomshaft

  • Hero Member
  • *****
  • Posts: 862
  • Osshaft for Osclass - Add 650 posts to my total
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #22 on: February 04, 2014, 12:39:35 am »
Why is this line in the actual page code or why not the correct space "&nbsp". What is that "A".
<p style="text-align: center;">Â&nbsp;</p>

&nbsp; is the entity used to represent a non-breaking space. It is essentially a standard space, the primary difference being that a browser should not break (or wrap) a line of text at the point that this &nbsp; occupies.

Many WYSIWYG HTML editors insert these &nbsp; entities in an effort to control the layout of the HTML document. For example, such an editor may use a series of non-breaking spaces to indent a paragraph like this:

<P>
 &nbsp; &nbsp; &nbsp; This first line of text is supposed to be indented. However, many browsers will not render it as intended.
 </P>

As the example mentions, some browsers will not, in fact, indent the text because of how that particular browser handles the &nbsp; entity. Some browsers collapse multiple, concurrent non-breaking spaces into a single space. This sometimes happens, even if there are regular spaces separating the consecutive &nbsp; entities. So keep in mind that this "technique" can not be relied on.

There are some times when it is "acceptable" or "advisable" to use the &nbsp; entity so long as the consequences are understood:

Its intended use of creating a space between words or elements that should not be broken. The only problems that can be associated with this use is that too many words strung together with non-breaking spaces may require some graphical browsers to show horizontal scrollbars or cause them to display the text overlapping table borders.


If you need to have an empty table cell, it is often advised that you add a non-breaking space like <TD>&nbsp;</TD>. This is because some versions of IE seem to have problems with completely empty table cells.


Indentation. It is generally discouraged to use a non-breaking space, or a series of non-breaking spaces to "force" an indentation. This practice is discouraged for two primary reasons. First, not all browsers handle the &nbsp; entity properly and may in fact ignore it when rendering the document. Second, the practice of trying to "force" a specific presentation is often frowned upon as it tends to fail and/or makes it more difficult for some readers whose browsers may be configured differently from your own.


Just thought I would fill this gray space...... ;D :P

Tom
« Last Edit: February 04, 2014, 12:44:53 am by tomshaft »

nootkan

  • Sr. Member
  • ****
  • Posts: 259
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #23 on: February 04, 2014, 01:59:56 am »
Tom, I removed the code you referenced from the html header widget and that got rid of the special character so you were right about the wysiwyg text editor and spaces.   I also notice some characters next to the text in the header and footer widget admin section (see the image).  Will look at why that is occurring at a later date.



I noticed that the doc type is missing from the osshaft_colors header.php file so I added the same one from the bender theme but that didn't make a difference either.

Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
« Last Edit: February 04, 2014, 03:43:36 am by nootkan »

nootkan

  • Sr. Member
  • ****
  • Posts: 259
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #24 on: February 04, 2014, 02:57:52 am »
Tom, I think I figured it out.  None of your css for theme osshaft_colors is being inherited by the payment/menu or payment/pack pages even though the elements have the same name as the other pages in the theme.
« Last Edit: February 04, 2014, 03:44:21 am by nootkan »

nootkan

  • Sr. Member
  • ****
  • Posts: 259
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #25 on: February 04, 2014, 03:42:11 am »
Wahoo, I figured it out.  It was definately a styling issue.  For anyone else who is trying to do this you must include the following inside your header.php file for the osshaft_colors theme.

Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="<?php echo str_replace('_''-'osc_current_user_locale()); ?>">
<head>
        <?php osc_current_web_theme_path('head.php'); ?>
        <meta name="robots" content="index, follow" />
        <meta name="googlebot" content="index, follow" />
    </head>
<!-- container -->

and this is what is inside my user-custom.php file:

Code: [Select]
<?php
    
/*
     *      Osclass – software for creating and publishing online classified
     *                           advertising platforms
     *
     *                        Copyright (C) 2013 OSCLASS
     *
     *       This program is free software: you can redistribute it and/or
     *     modify it under the terms of the GNU Affero General Public License
     *     as published by the Free Software Foundation, either version 3 of
     *            the License, or (at your option) any later version.
     *
     *     This program is distributed in the hope that it will be useful, but
     *         WITHOUT ANY WARRANTY; without even the implied warranty of
     *        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     *             GNU Affero General Public License for more details.
     *
     *      You should have received a copy of the GNU Affero General Public
     * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
     */

    
osc_current_web_theme_path('header.php') ;

    
osc_render_file();

    
osc_current_web_theme_path('footer.php');
?>

This seems to work just fine for me now.  Whew what a drawn out process for something I should have thought of first and foremost.  Thanks to all who provided me with direction and support.  Much appreciated!  ;D

tomshaft

  • Hero Member
  • *****
  • Posts: 862
  • Osshaft for Osclass - Add 650 posts to my total
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #26 on: February 04, 2014, 10:50:43 am »
Tom, I think I figured it out.  None of your css for theme osshaft_colors is being inherited by the payment/menu or payment/pack pages even though the elements have the same name as the other pages in the theme.

Or,
The plugin was/is not drawing from the theme styling.... If the plugin does not have or is designed to use the theme css then the plugin must be looking in the wrong place or looking for wrong named css file. If that is the case then what happens with all the themes that use varying named css files. bender being "main". Others 'style", styles", etc. osshaft_colors uses a few different named css files depending on the choice made in admin.

The plugin dev knew when created that the plugin "needs" certain files coded in certain ways to work proper. Why would that dev "assume" that a theme or for that matter a core script would or even should be designed and scripted for HIS plugin.

Interesting that page after page concerning plugin issues are filled with "payment" type plugin problems with no clear indications that the problems are core or theme related or caused...... yet we keep modifying core and themes trying to accommodate or overcome these plugin problems.

So we are back to the problem of no real, concrete parameters  for plugins to follow......

When/ if everything works as intended the doc type should only have to be declared once in the head file unless an individual page has a special need.

The user-custom is just a generic page similar to others so really should not have to be modified for any one plugin.

Just my view on the world which I admit is from a much different angle..... :o

Happy you got it resolved... ;D and impressed you stuck with this plugin issue to a successful conclusion.
Tom
« Last Edit: February 04, 2014, 11:46:53 am by tomshaft »

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: <Resolved>Fixing Payment Plugin user-custom.php Issue
« Reply #27 on: February 04, 2014, 06:56:21 pm »
Also glad you got it solved Nootkan!

Quote
you must include the following inside your header.php file for the osshaft_colors theme

Tom, isn't head.php 'always' needed in page creation within OsClass?
Declarations/registrations are done in head.php as well as some other basic stuff needed to display a correct OsClass page but maybe the page is setup in another way in that theme?

The issue was the missing head.php I think that actually sets the filepaths to CSS and others. Meaning, plugins without their own CSS will default to the default OsClass CSS but then in their page setup the header.php must include the head.php.

Structure of page setup:
                                    head =>
                                                   header (widget(s)) =>
                                                                                       page
                                                     footer (widget(s)) =>

As far as the 'wrong' codes, if you used an editor with the wrong characterset chances are you will Always end up with 'wrong' output even though everything looks normal. Always use a decent editor like Notepad++ and Always make sure you are using the right characterset/codepage = UTF8.


Regards,
Eric

tomshaft

  • Hero Member
  • *****
  • Posts: 862
  • Osshaft for Osclass - Add 650 posts to my total
Re: <Resolved>Fixing Payment Plugin user-custom.php Issue
« Reply #28 on: February 04, 2014, 07:33:20 pm »
Also glad you got it solved Nootkan!

Quote
you must include the following inside your header.php file for the osshaft_colors theme

Tom, isn't head.php 'always' needed in page creation within OsClass?
Declarations/registrations are done in head.php as well as some other basic stuff needed to display a correct OsClass page but maybe the page is setup in another way in that theme?

The issue was the missing head.php I think that actually sets the filepaths to CSS and others. Meaning, plugins without their own CSS will default to the default OsClass CSS but then in their page setup the header.php must include the head.php.

Structure of page setup:
                                    head =>
                                                   header (widget(s)) =>
                                                                                       page
                                                     footer (widget(s)) =>

As far as the 'wrong' codes, if you used an editor with the wrong characterset chances are you will Always end up with 'wrong' output even though everything looks normal. Always use a decent editor like Notepad++ and Always make sure you are using the right characterset/codepage = UTF8.


Regards,
Eric

Perhaps this is a misunderstanding of what I was trying to say.....

Yes, of course to your head comments.

Only editor I use is notepad++ set to utf8. Have a couple others installed but haven't used them in along time.


nootkan

  • Sr. Member
  • ****
  • Posts: 259
Re: <Resolved>Fixing Payment Plugin user-custom.php Issue
« Reply #29 on: February 04, 2014, 09:07:03 pm »
I guess I spoke too soon.  It seems that after fixing my issue with the payment plugin and the user-custom.php file to render my payment/menu page properly, placing the
Code: [Select]
<?php osc_current_web_theme_path('head.php'); ?> inside the header.php file is now making my login dropdown in the header of the site to drop and close immediately.  What is happening I believe is that my head content between the <head> tags is being duplicated.  There has to be a way to make this work.
« Last Edit: February 04, 2014, 09:33:27 pm by nootkan »