problem with instalation on two domains

Get help with installation and running PivotX 2.0.x here. Please do not post Extension or Theme related questions here.

problem with instalation on two domains

Postby jan » Wed Jul 01, 2015 4:26 am

Hello I installed pivotx and really like it.
I run two websites and use pivotx for the blog functionality. I installed it on one domain everything fine and works.
I copied and pasted the files to my other domain changed some theme files so it fits in the layout, and everything works except for the uploaded images that i use in blogs.
Which is not strange since the images a in folder on the other domain......
Is there an easy way to change the code so the images have an absolute path?
Or any other simple solution?
Thanks in advance for your answer

Jan
jan
 
Posts: 3
Joined: Mon Jun 29, 2015 5:38 am
Location: Bali, Indonesia

Re: problem with instalation on two domains

Postby Harm10 » Thu Jul 02, 2015 8:16 pm

You can try to manipulate the setting called upload_path in advanced configuration but I think it is always meant as a relative path.
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2010
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: problem with instalation on two domains

Postby jan » Fri Jul 03, 2015 4:18 am

MMh thanks tried it, but you are right it's meant to be relative and really did not like it.
Anyone any other ideas>
jan
 
Posts: 3
Joined: Mon Jun 29, 2015 5:38 am
Location: Bali, Indonesia

Re: problem with instalation on two domains

Postby Harm10 » Sat Jul 04, 2015 8:29 am

You could try to overrule the value for $PIVOTX['paths']['upload_path'] (which is the full path name) in your templates through php coding.
You can check whether you have succeeded in the modifier display when you switch on debug option.

If you succeed you should also change upload_url / upload_base_path / upload_base_url because one piece of code can use the one and or the other.
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2010
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: problem with instalation on two domains

Postby jan » Sun Jul 05, 2015 6:03 am

Thanks Harm, I also did some more digging and found a solution maybe a bit of a duck tape one, but in my scenario what i use it for it works.
In module_smarty.php I found:

Code: Select all
// only continue if we have an image
    if( file_exists( $PIVOTX['paths']['upload_base_path'].$filename )) {

        $filename = fixpath( $PIVOTX['paths']['upload_base_url'].$filename );

        switch( $align) {
            case( 'left' ):
            case( 'right' ):
                $output   = '<img src="'.$filename.'" ';
                $output  .= 'title="'.$alt.'" alt="'.$alt.'"';
                if (!empty($width)) { $output  .= ' width="'.$width.'"'; }
                if (!empty($height)) { $output  .= ' height="'.$height.'"'; }               
                $output  .= ' class="'.$class.'"'.$id.' />';
                break;
Well there are some more lines but just to illustrate it I chnaged it to

Code: Select all
// only continue if we have an image
    if( file_exists( $PIVOTX['paths']['upload_base_path'].$filename )) {

        $filename = fixpath( $PIVOTX['paths']['upload_base_url'].$filename );

        switch( $align) {
            case( 'left' ):
            case( 'right' ):
                $output   = '<img src="http://www.example.com'.$filename.'" ';
                $output  .= 'title="'.$alt.'" alt="'.$alt.'"';
                if (!empty($width)) { $output  .= ' width="'.$width.'"'; }
                if (!empty($height)) { $output  .= ' height="'.$height.'"'; }               
                $output  .= ' class="'.$class.'"'.$id.' />';
                break;

And it works, I use one domain for management and one for display :D

Thanks for your help
jan
 
Posts: 3
Joined: Mon Jun 29, 2015 5:38 am
Location: Bali, Indonesia

Re: problem with instalation on two domains

Postby Harm10 » Sun Jul 05, 2015 10:27 am

Weird that it works for you as I understood your problem.
Looking at your code you leave the if file_exists there so you are still checking for the filename in the domain PivotX is in.

You should also be aware that you changed a file in the core code and any fix to it in a new release overwrites yours.
The chance for a fix is low because development on PivotX has long stopped and only error fixing is still done.
(Bolt is the successor of PivotX).

But if you are happy then it is OK!
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2010
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)


Return to 2.x Support Forum

Who is online

Users browsing this forum: No registered users and 6 guests

cron