samtiria / nextgen-gallery

Automatically exported from code.google.com/p/nextgen-gallery
0 stars 0 forks source link

getting ?callback=ngg-ajax Insufficient parameters. #337

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. This seems to be a problem with every install and it is causing SEO and 
search ranking problems for my personal website and what seems to be every 
client site; furthermore It seems to be a problem on all installs of the 
gallery. google: "index.php?callback=ngg-ajax"
better yet. Let me google that for you... 
http://lmgtfy.com/?q=index.php%3Fcallback%3Dngg-ajax

check out page 2-9 of the search result... 

Now.. I found a few people having the same problem but no fix, hoping you can 
help.
2. seems the problem is around line 350 in nggallery.php

3. PLEASE HELLP :)

What is the expected output? What do you see instead?
Functional :)

What version of the product are you using? On what operating system?
Newest ver of both NGG and WP (WP 3.0.4)

Please provide any additional information below.

Thanks very much!!!  Paul

Original issue reported on code.google.com by PALe...@gmail.com on 22 Jan 2011 at 9:30

GoogleCodeExporter commented 8 years ago
Hi i discovered  the same problem wp 3.04 newest NGG  i believe it might be the 
AJAX pagination just turned it off and will tell you if it works

Tsvetan

Original comment by tzen...@gmail.com on 28 Jan 2011 at 3:18

GoogleCodeExporter commented 8 years ago
Indeed it's part of the ajax pagination... need to check this in deep

Original comment by alex.cologne on 29 Jan 2011 at 1:14

GoogleCodeExporter commented 8 years ago
Temp fix was send to me by the webmaster "the web magician" of  
http://www.fibank.bg/ 

" go to /wp-content/plugins/nextgen-gallery/xml/ajax.php 

line 4 to 5 should look like this 

if ((!isset($_GET['galleryid']) || !is_numeric($_GET['galleryid'])) ||
(!isset($_GET['p']) || !is_numeric($_GET['p'])) || !isset($_GET['type']))
     die('Insufficient parameters.');

replace it with 

if ((!isset($_GET['galleryid']) || !is_numeric($_GET['galleryid'])) ||
(!isset($_GET['p']) || !is_numeric($_GET['p'])) || !isset($_GET['type'])){
     if($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'){
         die('Insufficient parameters.');
     }else{
         header('Location: http://www.myblog.com'); /* your website url */
     }
}

Original comment by tzen...@gmail.com on 31 Jan 2011 at 3:38

GoogleCodeExporter commented 8 years ago
Well this gave me a blank page, but better then : Insufficient Parameters :) 

Alex, any luck on this?

Original comment by PALe...@gmail.com on 31 Jan 2011 at 5:21

GoogleCodeExporter commented 8 years ago
I replaced the code with the new one, now I'm waiting for better indexing in 
Google ?!?

Original comment by mebel...@mail.bg on 31 Jan 2011 at 5:49

GoogleCodeExporter commented 8 years ago
well this should give you new header new url (redirect) and google will replace 
the insufficient parameters page with your index , at the moment google 
indexing is kinda slow maybe because the new indexing engine.
Pal how come it is giving you blank page .... if this isnt working try 
searching in url for index.php?callback=ngg-ajax and replace it with index.php 
header location and should work .

As soon as google finds this page will remove it from the index.

getting the url 
http://www.learnphponline.com/php-basics/how-to-find-the-current-url-in-php 

searching/replacing in string 
http://php.net/manual/en/function.substr-replace.php

header .. location  and you are ready if it doesn't work tell us 

Original comment by tzen...@gmail.com on 31 Jan 2011 at 8:09

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
When i changed the code, there is a change in my site indexing. There is 1 
indexed page in google, now I'm waiting for all the pages to be indexed.

Original comment by mebel...@mail.bg on 2 Feb 2011 at 1:24

GoogleCodeExporter commented 8 years ago
Paul, 
Blank page may means there are errors (often syntax errors) on php script and 
the execution is stopped. 

You have to be sure you are placing the code above in the right place as 
substitution of the right peace of old code.

Original comment by lyubo.sl...@gmail.com on 3 Feb 2011 at 11:46

GoogleCodeExporter commented 8 years ago
I will recommend to put a die() after header('Location: url.here');
It will stop further execution and will prevent any output from the NGG 
ajax.php native logic.

The replacement code shoud look like this:
if ((!isset($_GET['galleryid']) || !is_numeric($_GET['galleryid'])) ||
(!isset($_GET['p']) || !is_numeric($_GET['p'])) || !isset($_GET['type'])){
     if($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'){
         die('Insufficient parameters.');
     }else{
         header('Location: http://www.myblog.com'); /* your website url */
         die();
     }
}

Original comment by lyubo.sl...@gmail.com on 3 Feb 2011 at 7:13

GoogleCodeExporter commented 8 years ago
Worked GREAT! Thanks! 

It now forwards to my index

Original comment by PALe...@gmail.com on 10 Feb 2011 at 7:06

GoogleCodeExporter commented 8 years ago
Should be fixed with r914, thanks for the feedback

Original comment by alex.cologne on 15 Feb 2011 at 9:37