Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues
Author Message
mrix
Client



Joined: Dec 04, 2004
Posts: 757

PostPosted: Tue May 18, 2010 8:53 am Reply with quote

Hello all I really like the way the google ads on this site are added to the search function Very Happy
Where could I add the code my end to do the same???
thanks for any help all.
mrix
 
View user's profile Send private message Visit poster's website
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Wed May 19, 2010 8:42 am Reply with quote

Signup for Google CSE
http://www.google.com/cse/

and there are options for integrating your adsense acct...
 
View user's profile Send private message Visit poster's website
mrix







PostPosted: Wed May 19, 2010 8:55 am Reply with quote

Yea I have registered for the search engine but am not sure what file of my ravennuke install I have to edit / where to put the code, to get it to display the same as Raven has etc.
cheers
mrix
 
spasticdonkey







PostPosted: Wed May 19, 2010 11:21 am Reply with quote

i would probably add it to themes/YOUR_THEME/forums/overall_header.tpl
 
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1123

PostPosted: Thu May 20, 2010 2:41 am Reply with quote

can you show an example spasticdonkey?
 
View user's profile Send private message
mrix







PostPosted: Thu May 20, 2010 3:50 am Reply with quote

Quote:
i would probably add it to themes/YOUR_THEME/forums/overall_header.tpl


I only really want it to appear when you click on the search function.

Would you have an idea where the code is most likely to be placed at all within the overall_header.tpl?

cheers and thanks
mrix
 
spasticdonkey







PostPosted: Thu May 20, 2010 7:07 am Reply with quote

Quote:
I only really want it to appear when you click on the search function.


I was able to integrate google ajax search into the search module (not forums search), so that it queries both the site search and google cse at the same time.. even works with the nukeNAV modal search too Smile
http://trickedoutnews.com/ftopict-49.html

Quote:
Would you have an idea where the code is most likely to be placed at all within the overall_header.tpl?


it would depend on the theme, but here is fisubice example..

you need to load the google cse script in the head, so get the JS code they give you and create a text file with the code and save as custom-search.js (do not use notepad) and upload to your root/includes/ folder. Then create a php file to load the script, and upload to your root/includes/addons/ folder... name it head-search.php
Code:
<?php

if (stristr(htmlentities($_SERVER['PHP_SELF']), 'head-search.php')) {
   Header('Location: ../../index.php');
   die();
}
addJSToHead('includes/custom-search.js', 'file');
?>

now all you have to do is add the html to your template
before
Code:
<!-- BEGIN switch_enable_pm_popup -->

<script language="Javascript" type="text/javascript">
<!--
   if ( {PRIVATE_MESSAGE_NEW_FLAG} )
   {
      window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;
   }
//-->
</script>
<!-- END switch_enable_pm_popup -->

<a name="top"></a>

<table width="100%" cellspacing="0" cellpadding="10" border="0" align="center">
<tr>
<td><!-- <table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr> -->
<table cellspacing="0" cellpadding="2" border="0" align="center">
<tr>
<td class="navbkg2">&nbsp; <a href="{U_FAQ}">{L_FAQ}</a>&nbsp; •&nbsp; <a href="{U_SEARCH}">{L_SEARCH}</a>&nbsp; •&nbsp; <a href="{U_MEMBERLIST}">{L_MEMBERLIST}</a>&nbsp; •&nbsp; <a href="{U_GROUP_CP}">{L_USERGROUPS}</a>&nbsp; •&nbsp; <a href="{U_PROFILE}">{L_PROFILE}</a>&nbsp; •&nbsp; <a href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}</a>&nbsp;
 •&nbsp; <a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a></td>
</tr>
</table>
</td></tr></table>
<br />


AFTER (just replace YOUR_DIV_ID with the id called in your custom-search.js file)
Code:
<!-- BEGIN switch_enable_pm_popup -->

<script language="Javascript" type="text/javascript">
<!--
   if ( {PRIVATE_MESSAGE_NEW_FLAG} )
   {
      window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;
   }
//-->
</script>
<!-- END switch_enable_pm_popup -->

<a name="top"></a>

<table width="100%" cellspacing="0" cellpadding="10" border="0" align="center">
<tr>
<td><!-- <table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr> -->
<table cellspacing="0" cellpadding="2" border="0" align="center">
<tr>
<td class="navbkg2">&nbsp; <a href="{U_FAQ}">{L_FAQ}</a>&nbsp; •&nbsp; <a href="{U_SEARCH}">{L_SEARCH}</a>&nbsp; •&nbsp; <a href="{U_MEMBERLIST}">{L_MEMBERLIST}</a>&nbsp; •&nbsp; <a href="{U_GROUP_CP}">{L_USERGROUPS}</a>&nbsp; •&nbsp; <a href="{U_PROFILE}">{L_PROFILE}</a>&nbsp; •&nbsp; <a href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}</a>&nbsp;
 •&nbsp; <a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a>
<div id="YOUR_DIV_ID">Loading...</div>
</td>
</tr>
</table>
</td></tr></table>
<br />


there are alot of options and how to's available in setting up your google cse, so your setup may differ. I noticed they also added an auto-complete feature recently Smile
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©