EDL 2.1 not updating points on download

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   EDL 2.1 not updating points on download
macrossmerrell
CZ Newbie
macrossmerrell has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: May 09, 2005
0.00 posts per day
Posts: 4
Points: 159
   
Hi all,

Sorry to post this here, but I have the EDL 2.1 system running nicely on my PhpNuke 7.5 site. Unfortunately it is ignoring my Group setting to give a point when someone opens / clicks on a download.

Can anyone advise on how to fix this issue as Nuke Styles is still down.

Thanks!

Merrell



Back to top Reply with quote
#2   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
I didn't know it did that. Can you paste your function getit or nsgetit or something like that here so I can take a look. Its in the index.php of the module I believe.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   re: EDL 2.1 not updating points on download
macrossmerrell
CZ Newbie
macrossmerrell has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: May 09, 2005
0.00 posts per day
Posts: 4
Points: 159
   
Ok, here is the phpnuke 7.5 download getit section:

function getit($lid) {
    global $prefix, $db;
    $lid = intval($lid);
    $db->sql_query("update ".$prefix."_downloads_downloads set hits=hits+1 WHERE lid='$lid'");
    update_points(17);
    $result = $db->sql_query("SELECT url FROM ".$prefix."_downloads_downloads WHERE lid='$lid'");
    list($url) = $db->sql_fetchrow($result);
    Header("Location: $url");
}


Here is the EDL 2.1 getit:
function getit($lid) {
$lid = intval($lid);
global $prefix, $dbi, $module_name, $user;
$result = sql_query("select ns_dl_reg_down from ".$prefix."_ns_downloads_general", $dbi);
list($ns_dl_reg_down) = sql_fetch_row($result, $dbi);
$result_get = sql_query("select ns_getit from ".$prefix."_ns_downloads_fetch", $dbi);
list($ns_getit) = sql_fetch_row($result_get, $dbi);
$result2 = sql_query("select cid, url from ".$prefix."_downloads_downloads where lid='$lid'", $dbi);
list($cid, $url)=sql_fetch_row($result2, $dbi);
$cid = intval($cid);
    if (file_exists("modules/$module_name/copyright.php")) {
   if ($ns_dl_reg_down == 0) {
      if ($ns_getit == 1) {
         Header("Location: modules.php?name=$module_name&d_op=ns_getit&cid=$cid&lid=$lid&type=url#get");
      } else {
          sql_query("update ".$prefix."_downloads_downloads set hits=hits+1 where lid='$lid'", $dbi);
          Header("Location: $url");
      }
    } else if ($ns_dl_reg_down == 1 && (is_user($user))) {
      if ($ns_getit == 1) {
         Header("Location: modules.php?name=$module_name&d_op=ns_getit&cid=$cid&lid=$lid&type=url#get");
      } else {
          sql_query("update ".$prefix."_downloads_downloads set hits=hits+1 where lid=$lid", $dbi);
          Header("Location: $url");
      }
    } else if ($ns_dl_reg_down == 1 && (!is_user($user))) {   
       include("header.php");
       menu(1);
       echo "<a name=\"dl\">";
       ns_mod_title3("download_reg",""._REGDOWNLOAD."");
       OpenTable();
       ns_dl_register2($dlreg = 2);
       CloseTable();
       ns_dl_link_bar($maindownload = 1);
   }
       } else {
          die();
    }
}


I tried just cutting and pasting the
    $db->sql_query("update ".$prefix."_downloads_downloads set hits=hits+1 WHERE lid='$lid'");
    update_points(17);
into the EDL index.html file in the getit section in the same location but it breaks the download feature. Seems to stop processing and not handing off the file.

Thanks!!!

Merrell


Back to top Reply with quote
#4   re: EDL 2.1 not updating points on download
macrossmerrell
CZ Newbie
macrossmerrell has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: May 09, 2005
0.00 posts per day
Posts: 4
Points: 159
   
HAHA,

Ok, I had to add the $db to the Globals and it works.

THANK YOU for pointing me in the right direction!!!

Here is the working code:

function getit($lid) {
$lid = intval($lid);
global $prefix, $dbi, $module_name, $user, $db;
$db->sql_query("update ".$prefix."_downloads_downloads set hits=hits+1 WHERE lid='$lid'");
    update_points(17);
$result = sql_query("select ns_dl_reg_down from ".$prefix."_ns_downloads_general", $dbi);
list($ns_dl_reg_down) = sql_fetch_row($result, $dbi);
$result_get = sql_query("select ns_getit from ".$prefix."_ns_downloads_fetch", $dbi);
list($ns_getit) = sql_fetch_row($result_get, $dbi);
$result2 = sql_query("select cid, url from ".$prefix."_downloads_downloads where lid='$lid'", $dbi);
list($cid, $url)=sql_fetch_row($result2, $dbi);
$cid = intval($cid);
    if (file_exists("modules/$module_name/copyright.php")) {
   if ($ns_dl_reg_down == 0) {
      if ($ns_getit == 1) {
         Header("Location: modules.php?name=$module_name&d_op=ns_getit&cid=$cid&lid=$lid&type=url#get");
      } else {
          sql_query("update ".$prefix."_downloads_downloads set hits=hits+1 where lid='$lid'", $dbi);
          Header("Location: $url");
      }
    } else if ($ns_dl_reg_down == 1 && (is_user($user))) {
      if ($ns_getit == 1) {
         Header("Location: modules.php?name=$module_name&d_op=ns_getit&cid=$cid&lid=$lid&type=url#get");
      } else {
          sql_query("update ".$prefix."_downloads_downloads set hits=hits+1 where lid=$lid", $dbi);
          Header("Location: $url");
      }
    } else if ($ns_dl_reg_down == 1 && (!is_user($user))) {   
       include("header.php");
       menu(1);
       echo "<a name=\"dl\">";
       ns_mod_title3("download_reg",""._REGDOWNLOAD."");
       OpenTable();
       ns_dl_register2($dlreg = 2);
       CloseTable();
       ns_dl_link_bar($maindownload = 1);
   }
       } else {
          die();
    }
}


Merrell


Back to top Reply with quote
#5   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
Just add the update_points(17); Looks the edl is still using the old sql layer. You would have to change the global line and add $db for that query to work.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#6   
macrossmerrell
CZ Newbie
macrossmerrell has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: May 09, 2005
0.00 posts per day
Posts: 4
Points: 159
   


Originally posted by Telli @ Wed Oct 05, 2005 2:56 am:

Just add the update_points(17); Looks the edl is still using the old sql layer. You would have to change the global line and add $db for that query work.


You are correct and I beat ya to it new_rofl.gif

I would have never found it without your direction. THANK YOU!

Merrell



Back to top Reply with quote
#7   re: EDL 2.1 not updating points on download
Jazzy
CZ Super Newbie
Jazzy has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Sep 25, 2004
0.01 posts per day
Posts: 64
Points: 3,820
   
I just wish I knew how you got ED 2.1 to work with 7.5. I purchased it and never got it wokring or support.

I ended it with 17.a which won't allow me to add any downloads through the module.

I even tried to go back to the orig Download mod but still can't add downloads.



Back to top Reply with quote
#8   re: EDL 2.1 not updating points on download
CozmicShredder
CZ Newbie
CozmicShredder has been a member for over 20 year's 20 Year Member
usa.gif michigan.gif
Occupation: Robot Tech
Age: 58
Gender: Male
Website:
Status: Offline
Joined: Oct 06, 2004
0.00 posts per day
Posts: 13
Points: 4,883
AIM Address Yahoo Messenger MSN Messenger 
Could you share the completed rewrite of that bit of code please?

Or was that all needed to update in that last post with the script?



Back to top Reply with quote
#9   Re: re: EDL 2.1 not updating points on download
echo
CZ Wiz
 Codezwiz Site Donator
Gender: Male
Status: Offline
Joined: Oct 04, 2003
0.15 posts per day
Posts: 1147
Points: 93
   


Originally posted by Jazzy @ Sat Oct 08, 2005 1:06 pm:

I just wish I knew how you got ED 2.1 to work with 7.5. I purchased it and never got it wokring or support.

I ended it with 17.a which won't allow me to add any downloads through the module.

I even tried to go back to the orig Download mod but still can't add downloads.


I have attached the Nuke 7.5 patch as well as the other EDL fixes. I really don't know whats up with his site at the moment. Enjoy icon_biggrin.gif



Attached Files
fixes.zip (247.82 KB, Downloaded: 5235 Time(s))


Back to top Reply with quote
#10   re: EDL 2.1 not updating points on download
Jazzy
CZ Super Newbie
Jazzy has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Sep 25, 2004
0.01 posts per day
Posts: 64
Points: 3,820
   
Nevermind....I fixed it. I forgot I needed to re-install again but I deleted it because I couldn't get it to work.

So far its okay but now I need to test adding a download



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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 cannot attach files in this forum
You cannot download files in this forum