Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Siuntiniai tik nariams

Parašė Acer· 2008 Lie. 1 13:07:23
#1

Jeigu norite padaryti, kad jūsų puslapyje siuntinius leistu siųstis nariam, o juos matyti gali visi, ir, kad neleistų to apeiti darom taip:

Atsidarom downloads.php
DEFAULT (12 Eilutė):
if (isset($download_id)) {
   $res = 0;
   if ($data = dbarray(dbquery("SELECT download_url,download_cat FROM ".$db_prefix."downloads WHERE download_id='$download_id'"))) {
      $cdata = dbarray(dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id='".$data['download_cat']."'"));
      if (checkgroup($cdata['download_cat_access'])) {
         $res = 1;
         $result = dbquery("UPDATE ".$db_prefix."downloads SET download_count=download_count+1 WHERE download_id='$download_id'");
         redirect($data['download_url']);
      }
   }
   if ($res == 0) redirect("downloads.php");
}




keičiam į:

if (iMEMBER) {
if (isset($download_id)) {
   $res = 0;
   if ($data = dbarray(dbquery("SELECT download_url,download_cat FROM ".$db_prefix."downloads WHERE download_id='$download_id'"))) {
      $cdata = dbarray(dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id='".$data['download_cat']."'"));
      if (checkgroup($cdata['download_cat_access'])) {
         $res = 1;
         $result = dbquery("UPDATE ".$db_prefix."downloads SET download_count=download_count+1 WHERE download_id='$download_id'");
         redirect($data['download_url']);
      }
   }
   if ($res == 0) redirect("downloads.php");
}
} else {
if (isset($download_id)) {
   $res = 0;
   if ($data = dbarray(dbquery("SELECT download_url,download_cat FROM ".$db_prefix."downloads WHERE download_id='$download_id'"))) {
      $cdata = dbarray(dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id='".$data['download_cat']."'"));
      if (checkgroup($cdata['download_cat_access'])) {
         $res = 1;
         $result = dbquery("UPDATE ".$db_prefix."downloads SET download_count=download_count+0 WHERE download_id='$download_id'");
         redirect("register.php");
      }
   }
   if ($res == 0) redirect("downloads.php");
}
}




Ten kur raudonai, pakeiskit į puslapį į kurį perkels jeigu ne narys.