Welcome to Geeklog Friday, July 03 2020 @ 11:55 pm EDT

Geeklog Forums

Cookie problem with external pages and Noah's Classifieds

Page navigation


Status: offline

beewee

Forum User
Full Member
Registered: 05/08/03
Posts: 969
Location:The Netherlands, where else?
I installed this great plugin and used it to include Noah's Classifieds (one of the best free Classifieds scripts, want to try it because zClassifieds doesn't work and Classifads doesn't support images, I also don't want to use the GL userbase for the classifieds). Now I get the well-known 'headers already sent' error. I removed all whitespaces/returns (about 50..!) in the classifieds script but I still got that error.

After looking at the line numbers (the second number mentioned in the error-message) I think it is a cookie error. Here's a piece of the code from the mentioned line-numbers:
PHP Formatted Code
  $gorumroll->globalUserId = $gorumroll->sessionUserId =$this->id;
        $gorumroll->usrPassword = getPassword($this->password);    
        setcookie("globalUserId", $this->id,
                  Loginlib_ExpirationDate, $cookiePath);
        setcookie("sessionUserId", $this->id, 0, $cookiePath);
        setcookie("usrPassword", $gorumroll->usrPassword,
                  Loginlib_ExpirationDate, $cookiePath);
        $infoText = sprintf($lll["greeting"],
                            htmlspecialchars($this->name) );

 


Since I'm no cookie-expert, who can help me out?

You can view the result/problem over here
Dutch Geeklog sites about camping/hiking: www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 05/08/03
Posts: 969
Location:The Netherlands, where else?
Well, after reading a great story about this at the dutch phpfreakz.nl site and some hard thinking I found it: removing the cookie path in the GL config.php.

Man, I'm happy! Now it's just skinning and translating to get a great addition to my portal.

BTW Noah's Classifieds is a really nice (and still free) classifieds script. But you might have to remove some whitespaces/returns at a dozen pages....
Dutch Geeklog sites about camping/hiking: www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Status: offline

samstone

Forum User
Full Member
Registered: 29/09/02
Posts: 820
So you just plug it as an external page? I might try that.

Is it possible to RSS it?

Sam
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 05/08/03
Posts: 969
Location:The Netherlands, where else?
That's right, the external pages plugin wraps it in GL. I'm using the geekphphtml template (provided with the external pages plugin). The templates have a small error at the end, but you'll notice that when you use it, easy to solve, (yes) must me ('yes').

I don't know if it's possible to rss it. Will try it sometime.

By, Bas
Dutch Geeklog sites about camping/hiking: www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Henna

Anonymous
Is it possible to use the same user login and pw for Noahs as GL, somehow ??
 Quote

Status: offline

samstone

Forum User
Full Member
Registered: 29/09/02
Posts: 820
Henna,

Using external pages means it is just wraped in GL. If you want to use GL login, you need to make it into a plugin.

I am still testing out the program, it looks on the skin, but I don't know how much muscle it has. if it does, we might want to look into it as a possible plugin.

Sam
 Quote

Henna

Anonymous
That will be great indeed .

I have tested zclassified also - it works , but multiple image upload and the limit to image size do not work. Also when one tries to edit the photo in a published ad there is error messages and no change of photo ( or picture ).
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 05/08/03
Posts: 969
Location:The Netherlands, where else?
And it shows the e-mail adresses if I'm correct, so you also get free spam by your junk cars....
Dutch Geeklog sites about camping/hiking: www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Status: offline

samstone

Forum User
Full Member
Registered: 29/09/02
Posts: 820
I have tested zclassified also - it works , but multiple image upload and the limit to image size do not work. Also when one tries to edit the photo in a published ad there is error messages and no change of photo ( or picture ).


Multiple image upload works for me, and I have done some adjustment to created scaled thumb nail (rather than distored fixed dimension), and make GD to produce full color.

Everything seems to run smothly until you told me that I can't edit the photos. It seems that there are some problem with account.php.
 Quote

Status: offline

samstone

Forum User
Full Member
Registered: 29/09/02
Posts: 820
Yap, edit some paths in account.php and the editing problem is gone.

PHP Formatted Code
//      OLD                     copy( $photo[ $i ], "{$IMAGE_DIR}/{$photoid}.jpg" );
                                copy( $photo[ $i ], "{$ADVT_PATH}/images/{$photoid}.jpg" );
                                                if ($_CONF_ADVT['$autothumbnail'] == 1 )
                                                {
//      OLD                     makeThumb( $photo[ $i ], "{$IMAGE_DIR}/thumb/{$photoid}.jpg" );
                                makeThumb( $photo[ $i ], "{$ADVT_PATH}/images/thumb/{$photoid}.jpg" );
                                                }
                                                else
                                                {
//      OLD                     copy( $thumb[ $i ], "{$IMAGE_DIR}/thumb/{$photoid}.jpg" );
                                copy( $thumb[ $i ], "{$ADVT_PATH}/images/thumb/{$photoid}.jpg" );



 



If you want the full color and scaled auto thumb nail function change that function at the bottom of functions.php to the following:


PHP Formatted Code
if ($_CONF_ADVT['$autothumbnail'] == 1 )
{
function makeThumb( $scrFile, $dstFile, $dstW=120, $dstH=100 )
        {
                global $_CONF;
                $im = ImageCreateFromJPEG( $scrFile );
                $srcW = ImageSX( $im );
                $srcH = ImageSY( $im );
                $ratio = ($srcW / $srcH);
                $newW = $dstW; 
                $newH= round(($dstW / $ratio));
                $ni = ImageCreateTrueColor( $newW, $newH );
                ImageCopyResized( $ni, $im, 0, 0, 0, 0, $newW, $newH, $srcW, $srcH );
                ImageJPEG( $ni, $dstFile );
        }
}
?>




 


I also made some minor changes to the layout files and add some css for cosmatic purpose. I don't remember those changes, but the above codes should get the zclassified functioning properly, I guess.

Replacing around line 145 on detail.php the "Ask Question" line with the following line, and deleting the following four lines would resolve the email revelation.

PHP Formatted Code
                echo "                    <td width=\"80%\" height=\"20\">{$user['fullname']} | <a href=\"{$_CONF['site_url']}/profiles.php?uid={$user[uid]}\"><b>Ask Question</b></a></td>\n";

 
 Quote

nick

Anonymous
@beewee

would you be able to show the code change,for the cookie fix please,
as my dutch isnt too great Wink ive hunted for days m8,

noahs classified is a cracker script , as its clean and very adaptable
exept integrations

thanks

nick





 Quote

Status: offline

samstone

Forum User
Full Member
Registered: 29/09/02
Posts: 820
I don't think beewee has got it fixed yet because when I go there using the above link, it is still showing the cookie error.

Still haven't played with Noah's Classifieds well enough to appreciate it beyond the skin.

Would be good to know what it can do that zClassifieds can't.

Sam
 Quote

Status: offline

ScurvyDawg

Forum User
Full Member
Registered: 06/11/02
Posts: 523
Hey Beewee I do not know if this will help but something I have done in the past that has solved this error is to make my GL cookie names unique.

I just went into my config.php and made all my cookie names slightly different. For instance on my www.scurvydawg.com website I appended SD to all the cookie names. I used to get that error at my Open Directory Project integration but that fixed it.

Also this may help - Forum Topic

Good luck and this is just a guess.
Blah Blah Blah Blah ...
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 05/08/03
Posts: 969
Location:The Netherlands, where else?
Oops, when I logout I see the error again....damn. It has something to do with the cookies and cookiedomain I guess. So I'll try to solve the problem by changing the cookie settings in config.php.

Noah's classifieds has plenty more under the hood then zClassifieds and Classifads, subcategories, lots of beatiful definable fields (select from custom list etc.) etc.

But I'll start with the cookies again...I don't use Javascript, and a normal HTML heade, changed all cookie settings in config.php and browsers so I don't know where to start.......
Dutch Geeklog sites about camping/hiking: www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

nick

Anonymous
thanx for the info, i will keep on visiting and looking,


atm im contemplating a tempory workaround, tis very rough though, using true
and turning off all options except submit/home/login (invisible)
and embedding it into a registered user area.

swapping back to false when needed

cheers

nick


 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 05/08/03
Posts: 969
Location:The Netherlands, where else?
I think I won't be able to solve the cookie problem. Changed so much that I even cannot login in GL at the moment... I know that the headers problem is caused by two the use of separate sessions, one from GL and the second from Noah's. Tried to solve it by output buffering but that did not work out very well. I've spent over 8 hours looking at cookies and I'm too tired to think. So I have some options:

- Change the layout of Noah's classifieds according to my GL site (this script makes it possible to change the header and footer) and only link to it, instead of wrapping. This will work but limits some possibilities like left/right blocks.

- Change Noah's cookie settings so it read's GL's user cookie and thinks these are Noah's cookies (a really weird idea I believe, but worth trying, but this probably won't solve the headers problem)

- Make a real Noah's classifieds plugin to use the GL userdatabase and sessions. (but I'm absolutely no programmer)

- Turn back to zClassifieds and use the GL userdatabase and sessions.

I like Noah's classifieds, but I don't have the time to keep trying so I'll stick for the last option for the moment.
So, @Sam Stone, it looks you've adapted zClassifieds the way I need it, but where can I see it in action?
Dutch Geeklog sites about camping/hiking: www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Tami

Anonymous
Hello,

just searching through the internet, cause i've got a problem with the noahs classifieds thumbs.

The Thumb Nails are shown in very bad quality on my side (nearly grey). Can anyone tell me, where I can change this? Which file and what do i need to do?

I'd be very graetful, cause I'm pretty new to all those scripts, but they are very useful for our community.

Thanx very much,
Tami Very Happy

Ohhh, here ist the link to our Problem >>>

http://web20.reseller5.publicompserver.de
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 05/08/03
Posts: 969
Location:The Netherlands, where else?
Try to find the settings and adjust the thumnail size, make a bit larger (often helps)
Dutch Geeklog sites about camping/hiking: www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Tami

Anonymous
I've tried to expand the thumbnail size. Nevertheless, the Thumbs still look like a very bad quality. I try to show you, what i mean:



Any other ideas?
Thanx,
Tami
 Quote

Status: offline

samstone

Forum User
Full Member
Registered: 29/09/02
Posts: 820
I don't use Noah's anymore so, this is only my suggestion.

Find the codes that create thumbnail and find the tag 'ImageCreate' and change it to 'ImageCreateTrueColor.'

That's what I did in zClassified to create full color thumbnail.

Sam
 Quote

Page navigation

All times are EDT. The time is now 11:55 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content