PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Mod Submissions

Reply
 
Thread Tools
Old 12-12-2003, 09:01 AM   #1
JÿGius³
Green Mole
 
Join Date: Oct 2003
Posts: 17
sponsored links, logged clicks...

Hi people

I've implemented some features. All the code is in
phpdig-1.6.5.zip
For each modification I've provided the line number.

1) search.php
- Added a $template_name variable in order to
avoid to put the entire template's path in form/link.

2) libs/search_function.php
- 18 Added a $template_name
- 352 Added $table_results['page_link']
onmousedown=\"return clk(".$spider_id.",this)\"
This javascript function (you can see it in template/phpdig.html)
call the php script (url.php) responsible
to log clicks as well.
- 383 Added &template_name=".trim($template_name). to $url_bar
- 453 Replaced $template with $template_name
- 458 Added sponsored links. These links are generated from
banners(). Sponsored links can be turned off with the SPONSORED_LINK
constant in includes/config.php
- 470 I've moved the page at the end of function in a separate file
called rescue_page.php; it'a a wasting time to parse it every time.
- 475 If you want sponsored links you have to implement banners().

3) libs/function_phpdig_form.php
- 36 The form method can be obtained from a FORM_METHOD constant?
- 37 Changed template_demo in template_name
- 52 Changed some form element
- 60 After a search, for each result there is a link to limit the search
to a specific site. I've added a form element for this function.

4) locales/it-language.php
- Added some little translation.

5) includes/config.php
- 17 Added the possibility to choose a template using url

6) sql/phpdig_log_click.sql
- Table to log clicks

7) template/phpdig.html
- At the beginning I've added the javascript code called when a user click
on a results link.

8) It would be nice if the logged clicks could be linked with the most searched terms.

You can compare my code with the official one with ease
using a diff tool.
Let me know if some feature is so nice to put it in the next
release.

Best regards.

JÿGius³



ps. I've just replaced the template. I've deleted my previous attachment; when I edit the post I can't add an attachment?
Why?

Last edited by JÿGius³; 12-13-2003 at 04:28 AM.
JÿGius³ is offline   Reply With Quote
Old 12-13-2003, 04:30 AM   #2
JÿGius³
Green Mole
 
Join Date: Oct 2003
Posts: 17
The replaced code.
Attached Files
File Type: zip phpdig-1.6.5.zip (17.7 KB, 91 views)
JÿGius³ is offline   Reply With Quote
Old 12-14-2003, 05:42 PM   #3
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. Thank you for the mods. Do you have a site setup with these mods for public view?

I'm not sure about the attachment problem. Maybe once deleted it won't accept a new attachment in an edited post?
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 12-18-2003, 09:27 AM   #4
alivin70
Orange Mole
 
alivin70's Avatar
 
Join Date: Sep 2003
Posts: 40
Quote:
Originally posted by Charter
Hi. Thank you for the mods. Do you have a site setup with these mods for public view?

I'm not sure about the attachment problem. Maybe once deleted it won't accept a new attachment in an edited post?
Hi, me and JyGius are working together on Phpdig, so I reply on this question.

Unfortunately we haven't yet a working demo online.

Most probably our Phpdig powered website will be online after Xmas holidays.

We published our mods because is long time we are working on it and we already had to import twice our mods in the new Phpdig releases. For that reason we decided to send the code now, instead of waiting to finish all the things we are working on.

We hope you will import our mods in the next release of Phpdig so we can continue to develop new features for it.

Long time ago I suggested using a CVS server to mantain the code synchronized. Without CVS you have to manually import changes from many developers. I know it's a little tricky for you.

Anyway, if you have questions about our changes, pleas ask
alivin70 is offline   Reply With Quote
Old 12-22-2003, 03:43 PM   #5
edgar
Green Mole
 
Join Date: Nov 2003
Posts: 5
what have does I to make thereby the sponsoren links functioned and which must I edit exactly and which syntax?

sorry for my bad english
edgar is offline   Reply With Quote
Old 12-26-2003, 04:51 PM   #6
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. In search_function.php from the above attached file, it looks like you'd need to fill in the below function.
PHP Code:
function banners($query_string){
    
///////    
    //////
    //////

__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 12-27-2003, 04:02 AM   #7
alivin70
Orange Mole
 
alivin70's Avatar
 
Join Date: Sep 2003
Posts: 40
Quote:
Originally posted by Charter
Hi. In search_function.php from the above attached file, it looks like you'd need to fill in the below function.
PHP Code:
function banners($query_string){
    
///////    
    //////
    //////

Yes,
you need to fill the banners function with specific queries for your ads server.

The steps are:
1) select text banners using $query_string (search keywords)
2) put the result in a string variable
3) output the html code in the template
alivin70 is offline   Reply With Quote
Old 12-27-2003, 07:45 AM   #8
edgar
Green Mole
 
Join Date: Nov 2003
Posts: 5
i dont unterstand

can you write an example
edgar is offline   Reply With Quote
Old 12-30-2003, 08:08 AM   #9
JÿGius³
Green Mole
 
Join Date: Oct 2003
Posts: 17
Hi All!
PHP Code:
function banners($query_string){
    
///////    
    // 1-select your banner using $query_string
    // 2-format your results in a string            
   //  variable using html  
    // 3- return this variable
    //////

The function is pretty simple

Best regards.

Gius
JÿGius³ is offline   Reply With Quote
Old 12-30-2003, 05:28 PM   #10
edgar
Green Mole
 
Join Date: Nov 2003
Posts: 5
i dont unterstand
edgar is offline   Reply With Quote
Old 12-31-2003, 03:57 AM   #11
alivin70
Orange Mole
 
alivin70's Avatar
 
Join Date: Sep 2003
Posts: 40
Hi, let me help you with some code (very simplified):

PHP Code:
function banners($query_string){
    
// 1-select your banner using $query_string
    // You shoud have something like this, dependimg on your AdServer
    
$query_ini ='SELECT DISTINCT B.bid,  B.url, B.text
            FROM '
.$prefix.'_banner_imp3 AS B
            WHERE B.keyword LIKE \'%'
.trim($query_string).'%\'';
    
$bresult = @mysql_query($query_ini);
    
// Count banner
    
$numrows = @mysql_num_rows($bresult);
   
    
// 2-format your results in a string          
    //  variable using html  
    
if ($numrows 0) {
          
$html '<b>Sonsored links</b> <br>'
          
while (list($bid,$url$text)=mysql_fetch_row($bresult){
                  
$html .="<a href=$url>$text</a><br>";     
                  
// do other things
          
}
    }         
   
    
// 3- return this variable
    
return $html;

So, you have to implement the function banners() accordingly with your AdServer (NOT present in Phpdig, try PhpAdsNew or others).

That function is called during a search and the html code is passed to the template:
PHP Code:
search_function.phplines around 460

if($query_string AND SPONSORED_LINKS != -1
    
$banner['adbanner'] = banners($query_string);
$t_strings array_merge($t_mstrings,$t_fstrings$banner);
phpdigParseTemplate($template,$t_strings,$table_results); 
Finally you have to print the html code in the template wherever you want

<!-- sponsored link -->
<phpdig:adbanner/>

that's all
alivin70 is offline   Reply With Quote
Old 04-29-2004, 07:29 AM   #12
RaGe
Green Mole
 
Join Date: Apr 2004
Posts: 12
So basicly this is the example content for adbanners.php?

Quote:
Originally posted by alivin70
[b]Hi, let me help you with some code (very simplified):

PHP Code:
function banners($query_string){
    
// 1-select your banner using $query_string
    // You shoud have something like this, dependimg on your AdServer
    
$query_ini ='SELECT DISTINCT B.bid,  B.url, B.text
            FROM '
.$prefix.'_banner_imp3 AS B
            WHERE B.keyword LIKE \'%'
.trim($query_string).'%\'';
    
$bresult = @mysql_query($query_ini);
    
// Count banner
    
$numrows = @mysql_num_rows($bresult);
   
    
// 2-format your results in a string          
    //  variable using html  
    
if ($numrows 0) {
          
$html '<b>Sonsored links</b> <br>'
          
while (list($bid,$url$text)=mysql_fetch_row($bresult){
                  
$html .="<a href=$url>$text</a><br>";     
                  
// do other things
          
}
    }         
   
    
// 3- return this variable
    
return $html;

So, you have to implement the function banners() accordingly with your AdServer (NOT present in Phpdig, try PhpAdsNew or others).
RaGe is offline   Reply With Quote
Old 04-29-2004, 07:53 AM   #13
alivin70
Orange Mole
 
alivin70's Avatar
 
Join Date: Sep 2003
Posts: 40
Quote:
Originally posted by RaGe
So basicly this is the example content for adbanners.php?
Yes, it is.

The most simplified version of banner() contains a single query to the ads table ("text ads" if you want Google-style Sponsored links) and returns the formatted code of sponsored links.
alivin70 is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bann URLs / Domains & Sponsored Links PL_90 Mod Requests 0 10-18-2007 05:23 AM
Text ads and sponsored links? WebSpider Mod Requests 2 03-09-2005 01:17 AM
sponsored links JÿGius³ Mod Submissions 9 04-29-2004 08:03 AM
Log clicks alivin70 Mod Submissions 4 02-24-2004 02:24 AM


All times are GMT -8. The time now is 08:17 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.