Jump to content
InvisionCommunity.de - Der Deutsche Invision Community Support
Sign in to follow this  
Silaz

DL Counter zählt nicht

Recommended Posts

hallo,

irgendwie raff ich es nicht.

Ich möchte gerne die Downloads bei den User zählen und diese im Profil anzeigen lassen aber egal was ich versuche es klappt net und wenn es dann doch klappt dann zählt er es bei dem gast.

Also hier der Org Code.

  if( $ibforums->member['g_do_download'] == 1 ) {

 	 $count              = $DB->fetch_row( );

 	 $count['downloads'] = $count['downloads'] + 1;

            if($ibforums->input['l'] == 1) {

          $download         = $count['link'];

            }else{

                $download         = $ibforums->vars['d_download_url'] . $count['URL'];

            }

//Agreement accepted?

            if($ibforums->input['agree'] != 1)

            {

               return $this->output.= $this->html->my_agreement();

            }

            

             	 $DB->query( "UPDATE ibf_download_files SET downloads =" . $count['downloads'] . " WHERE id = " . $id );

         

        



 	 header( "Location: $download" );

 	 exit;

  }

  else

  {

 	 $std->Error( array( 'LEVEL' => 1, 'MSG' => 'download_r') );

  }

	}
und hier der Code den ich jetzt als letztes versucht habe...
  if( $ibforums->member['g_do_download'] == 1 ) {

 	 $count              = $DB->fetch_row( );

 	 $count['downloads'] = $count['downloads'] + 1;

            if($ibforums->input['l'] == 1) {

          $download         = $count['link'];

            }else{

                $download         = $ibforums->vars['d_download_url'] . $count['URL'];

            }

//Agreement accepted?

            if($ibforums->input['agree'] != 1)

            {

               return $this->output.= $this->html->my_agreement();

            }

            

             if($ibforums->member['id'])

            {

                $DB->query("UPDATE ibf_members SET dlcount = dlcount+1 WHERE id='".$member['id']."'");

            }

 	 $DB->query( "UPDATE ibf_download_files SET downloads =" . $count['downloads'] . " WHERE id = " . $id );

         

        



 	 header( "Location: $download" );

 	 exit;

  }

  else

  {

 	 $std->Error( array( 'LEVEL' => 1, 'MSG' => 'download_r') );

  }

	}

Danke

Share this post


Link to post

Du willst die Downloads zählen von Dateien, die im Forum angehängt sind?

Also wenn du über index.php?act=attach eine Datei downloadest, spart sich Matt das Holen der Mittliederinformationen. Sprich du kannst es keinem Mitglied zuordnen und da wird wohl dein Problem liegen.

In der functions.php muß nur folgendes auskommentiert werden, dann holt er auch bei Downloads die Mitgliederinfos.

        if ( $ibforums->input['act'] == 'Attach' )
       {
       return $this->member;
       }

Share this post


Link to post

nein Sorry vergessen dabei zu schreiben ich möchte die im Download Mod zählen die im Forum selbst sind mir eigentlich egal :) wobei eigentlich könnte man die auch mit zählen...

Share this post


Link to post

Hast du mal geschaut, ob überhaupt etwas in der Variable $ibforums->member['id'] drin steht?

Kenne den Mod jetzt nicht und somit auch nicht seine Eigenarten.

Share this post


Link to post

Ich dachte es würde auf die Member Datenbank zugreifen weil er ja auch " if( $ibforums->member['g_do_download'] == 1 ) {" aufruft und das ist in der Member Tabelle ja drin.

Share this post


Link to post

Wie gesagt, ich kenne den Mod nicht und deshalb schalt doch einfach mal ein echo mit der entsprechenden Variable davor, dann siehst du es. :)

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×