News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Search Focus Dropdown

Started by Brettflan, February 14, 2009, 02:34:48 PM

Previous topic - Next topic

hcfwesker

Quote from: gisfreak on September 02, 2011, 02:35:49 AM
it cant skip properly on some file, here my error :

Execute Modification   ./Themes/TWcurve/index.template.php   File not found

thats just a file for a custom theme.  you dont have that theme, so its not needed.  it's safe to continue and install.  :)

EL34

Hi, The mod installs correctly in my 1,1,14 forum but every page shows a javascript error icon in the browser
Here's the full error message



Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E; FDM)
Timestamp: Sat, 10 Sep 2011 11:22:44 UTC


Message: 'searchForm' is null or not an object
Line: 6
Char: 1
Code: 0

URI: http://www.myforum/Forum/Themes/default/scripts/SearchFocus.js

Forum History -> EZBoard -> YABB -> SMF 1.1.19 -> SMF 2.0.19

Brettflan

Quote from: EL34 on September 10, 2011, 07:25:38 AM
Hi, The mod installs correctly in my 1,1,14 forum but every page shows a javascript error icon in the browser
Here's the full error message



Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E; FDM)
Timestamp: Sat, 10 Sep 2011 11:22:44 UTC


Message: 'searchForm' is null or not an object
Line: 6
Char: 1
Code: 0

URI: http://www.myforum/Forum/Themes/default/scripts/SearchFocus.js
Hmm, that's what I get for not testing the 1.1.x version. I'm sending you a test fix by PM; let me know if it fixes the problem, and I'll go ahead and release it if it does.

EL34

I just tested your new file and your fix seems to be working just fine.

Thanks, appreciate the quick response

Forum History -> EZBoard -> YABB -> SMF 1.1.19 -> SMF 2.0.19

Brettflan

OK then, went ahead and released it:
Quote from: Brettflan on February 14, 2009, 02:34:48 PM
version 1.6.1:

  • fix for bug on SMF 1.1.x versions which kept the mod from working at all

EL34

The mod seemed to be working for me, I was able to search the forum, topics and google.
Searching Bing did not work when I tested that.

I Just noticed the javascript error in the browser.

Thanks again
Forum History -> EZBoard -> YABB -> SMF 1.1.19 -> SMF 2.0.19

Brettflan

Quote from: EL34 on September 11, 2011, 07:17:05 AM
The mod seemed to be working for me, I was able to search the forum, topics and google.
Searching Bing did not work when I tested that.

I Just noticed the javascript error in the browser.

Thanks again
What version of SMF are you using?
What browser (and what version of it) are you using?
What javascript error did you receive?

ApplianceJunk

#247
Awesome mod, thanks!

How could I incorporate our google adsense code so it is used when google is selected on the drop down menu?

Here is the code we get from google to create are own google search text box.


<form action="http://www.google.com/cse" id="cse-search-box">
  <div>
    <input type="hidden" name="cx" value="partner-pub-9391510879744461:xgcasme4qx7" />
    <input type="hidden" name="ie" value="ISO-8859-1" />
    <input type="text" name="q" size="31" />
    <input type="submit" name="sa" value="Search" />
  </div>
</form>
<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en"></script>


Thanks,

Edited to add: After reading google adsense terms even if our adsense code can be used in your mod it may not be allowed by google, not sure...

QuoteAdSense for search:
A maximum of two Google AdSense for search boxes may be placed per page. Also, a single link unit or a search box, but no other Google ads, may be placed on pages with AdSense for search results. Queries must originate from users inputting data directly into the search box and cannot be modified. This includes pre-populating the search box with terms or hard-coding direct links to search results pages. AdSense for search code may not be integrated into any software application such as a toolbar.

Would this mod be considered a software application?

Thanks again,

EL34

See reply #241

It's working ok now as I reported in #243
Forum History -> EZBoard -> YABB -> SMF 1.1.19 -> SMF 2.0.19

Brettflan

Quote from: ApplianceJunk on September 11, 2011, 08:55:47 AM
Awesome mod, thanks!

How could I incorporate our google adsense code so it is used when google is selected on the drop down menu?

Here is the code we get from google to create are own google search text box.


<form action="http://www.google.com/cse" id="cse-search-box">
  <div>
    <input type="hidden" name="cx" value="partner-pub-9391510879744461:xgcasme4qx7" />
    <input type="hidden" name="ie" value="ISO-8859-1" />
    <input type="text" name="q" size="31" />
    <input type="submit" name="sa" value="Search" />
  </div>
</form>
<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en"></script>

Based on that code, this might do the trick. Change:
if ($s_focus == 'google')
header( 'Location: http://www.google.com/search?q=' . urlencode($_REQUEST['search']) . '&sitesearch=' . $site_domain );

To:
if ($s_focus == 'google')
header( 'Location: http://www.google.com/search?q=' . urlencode($_REQUEST['search']) . '&sitesearch=' . $site_domain . '&cx=partner-pub-9391510879744461:xgcasme4qx7&ie=ISO-8859-1&sa=Search' );


Worth a shot, anyway.

Quote from: ApplianceJunk on September 11, 2011, 08:55:47 AM
Edited to add: After reading google adsense terms even if our adsense code can be used in your mod it may not be allowed by google, not sure...

QuoteAdSense for search:
A maximum of two Google AdSense for search boxes may be placed per page. Also, a single link unit or a search box, but no other Google ads, may be placed on pages with AdSense for search results. Queries must originate from users inputting data directly into the search box and cannot be modified. This includes pre-populating the search box with terms or hard-coding direct links to search results pages. AdSense for search code may not be integrated into any software application such as a toolbar.

Would this mod be considered a software application?

Thanks again,
None of that should be a problem. They're referring to a browser toolbar, or other software on the user's system, not (apparently) software on the server.

ApplianceJunk

#250
What file would I look for that code in?

Thanks for the reply,

Edited to add: Think I found it

Sources>Search.php

Will try it and report back...

Thanks again.

Brettflan

Inside the Search Focus Dropdown zip file, either in 1.x.xml (if you're running SMF 1.1.x) or 2.x.xml (if you're running SMF 2.0).
If you directly edit Search.php, you'll be unable to uninstall the mod package correctly.

ApplianceJunk

Ok, I directly edited the Search.php and it works!

I have never tried to edit a mod zip file. I will check out doing that way too.

Thanks,

ApplianceJunk

Ok, I unzipped the file, edited 2.x.xml and zipped it.

I removed the original mod from my site without any problems and then tried to upload the new .zip that I edited.

I get a message,

QuotePackage upload failed due to the following error:
"Although the package was downloaded to the server it appears to be empty. Please check the Packages directory, and the "temp" sub-directory are both writable. If you continue to experience this problem you should try extracting the package on your PC and uploading the extracted files into a subdirectory in your Packages directory and try again. For example, if the package was called shout.tar.gz you should:
1) Download the package to your local PC and extract it into files.
2) Using an FTP client create a new directory in your "Packages" folder, in this example you may call it "shout".
3) Upload all the files from the extracted package to this directory.
4) Go back to the package manager browse page and the package will be automatically found by SMF."

I notice the original .zip file is 16kb and after I edit and zip it again it's 31kb.


Brettflan

Quote from: ApplianceJunk on September 12, 2011, 05:54:41 PM
Ok, I unzipped the file, edited 2.x.xml and zipped it.

I removed the original mod from my site without any problems and then tried to upload the new .zip that I edited.

I get a message,

QuotePackage upload failed due to the following error:
"Although the package was downloaded to the server it appears to be empty. Please check the Packages directory, and the "temp" sub-directory are both writable. If you continue to experience this problem you should try extracting the package on your PC and uploading the extracted files into a subdirectory in your Packages directory and try again. For example, if the package was called shout.tar.gz you should:
1) Download the package to your local PC and extract it into files.
2) Using an FTP client create a new directory in your "Packages" folder, in this example you may call it "shout".
3) Upload all the files from the extracted package to this directory.
4) Go back to the package manager browse page and the package will be automatically found by SMF."

I notice the original .zip file is 16kb and after I edit and zip it again it's 31kb.
What software are you using to zip the file up?

ApplianceJunk

QuoteWhat software are you using to zip the file up?

Good question, I'm on a Mac.
I right click on the search_focus_dropdown folder and select Compress search_focus_dropdown and it makes a search_focus_dropdown.zip

Brettflan

Quote from: ApplianceJunk on September 12, 2011, 06:46:50 PM
QuoteWhat software are you using to zip the file up?

Good question, I'm on a Mac.
I right click on the search_focus_dropdown folder and select Compress search_focus_dropdown and it makes a search_focus_dropdown.zip
I'm not sure about the best free archive software for Mac. A quick search based on 7-Zip turned up a couple of possibilities, though I can't vouch for either:
http://www.kekaosx.com/en/
http://www.macupdate.com/app/mac/19139/ez7z

ApplianceJunk

Ok, I will mess around with how to correctly zip a mod file on a Mac some other time.

For now the manual edit of the Search.php file is working great and I have easily been able to restore the original Search.php file and remove the mod that way just fine so I will just stick with doing it that way for now.

Thanks for all your help.

EL34

SMF 1.1.15 and  SF 1.6.1

Hi,
I am seeing this error message in the Forum error log

Quote8: Undefined variable: view
File: D:\hshome\el34xyz\el34world.com\Forum\Themes\default\languages\SearchFocus.english.php (eval?)
Line: 238
Not sure if this just started with the SMF 1.1.15 update or not?

Don't remember seeing this with 1.1.14
Forum History -> EZBoard -> YABB -> SMF 1.1.19 -> SMF 2.0.19

Brettflan

Quote from: EL34 on September 30, 2011, 10:37:32 AM
SMF 1.1.15 and  SF 1.6.1

Hi,
I am seeing this error message in the Forum error log

Quote8: Undefined variable: view
File: D:\hshome\el34xyz\el34world.com\Forum\Themes\default\languages\SearchFocus.english.php (eval?)
Line: 238
Not sure if this just started with the SMF 1.1.15 update or not?

Don't remember seeing this with 1.1.14
SearchFocus.english.php should be only 17 lines long (not 238+), and not even have the text "view" anywhere in it. What does your copy of the file look like?

Advertisement: