Jump to content
php.lv forumi

gkazhus

Reģistrētie lietotāji
  • Content Count

    54
  • Joined

  • Last visited

Everything posted by gkazhus

  1. if ( !in_array($GLOBALS['pagenow'], array('wp-login.php', 'wp-register.php' )) && !is_admin() && !is_user_logged_in() ) { wp_redirect('/wp-login.php', 301); exit; } Vai kaads luudzu var pateikt kur sheit man ir kluuda, jo atverot wp-register.php lapu ta tiek automatiski parmesta uz wp-login.php lapu lai gan esmu tacu pielicis, ka taa netiek redirektota. Ka es varu to izlabot?
  2. Tik kaa Wordpresaa dabuut aaraa username?
  3. Man ir nepiecieshamiiba izveidojot jaunu Menu linku lai shis links aizvestu uz piem. /users/USERNAME/ Vai arii ja tas ir izdarams varbut to var izdariit DB?
  4. Taatad meeginu izveidot lai man bildes nosaukums buutu taads pats kaa virsraksts - item-title bet taa vietaa es sanjemu shaadu izvadu: <img src="/uploads/Egles" ciekurs.jpg"="" class="image" alt="" style="background-color: rgb(245, 111, 20); width: 160px; height: 160px; display: block;" data-lazy-loaded="true"> Kaa lai es sho - Egles" ciekurs.jpg parversu Egles ciekurs.jpg Kods: $image='<img src="/uploads/'.$arr['item-title'].'.jpg" class="image" alt="" style="'.$image_style.$item_style.' width: '.$w.'px; height: '.$h.'px;" />';
  5. gkazhus

    Wink

    ok tnx.. tagad palika skaidraaka taa lieta ;)
  6. gkazhus

    Wink

    Mekleju padomu - Ka uztaisiit profilam ta lai cits lietotajs varetu "piemiegt ar aci" vai wink. Un pec tam tas butu redzams ka kads Tev ir piemiedzis...
  7. gkazhus

    preg_match

    Kaa lai pareizi pieraksta preg_match nosacijumus: šobrid sanjemu error Warning : preg_match() [ function.preg-match ]: Delimiter must not be alphanumeric or backslash $OSList = array ( // Match user agent string with operating systems 'Windows 3.11' => 'Win16', 'Windows 95' => '(Windows 95)|(Win95)|(Windows_95)', 'Windows 98' => '(Windows 98)|(Win98)', 'Windows 2000' => '(Windows NT 5.0)|(Windows 2000)', 'Windows XP' => '(Windows NT 5.1)|(Windows XP)', 'Windows Server 2003' => '(Windows NT 5.2)', 'Windows Vista' => '(Windows NT 6.0)', 'Windows 7' => '(Windows NT 6.1)|(Windows NT 7.0)', 'Windows NT 4.0' => '(Windows NT 4.0)|(WinNT4.0)|(WinNT)|(Windows NT)', 'Windows ME' => 'Windows ME', 'Open BSD' => 'OpenBSD', 'Sun OS' => 'SunOS', 'Linux' => '(Linux)|(X11)', 'Mac OS' => '(Mac_PowerPC)|(Macintosh)', 'QNX' => 'QNX', 'BeOS' => 'BeOS', 'OS/2' => 'OS/2', 'Mac OS' => 'Mac OS', 'Search Bot'=>'(nuhk)|(Googlebot)|(Yammybot)|(Openbot)|(Slurp)|(MSNBot)|(Ask Jeeves/Teoma)|(ia_archiver)' ); // Loop through the array of user agents and matching operating systems foreach($OSList as $CurrOS=>$Match) { // Find a match if (preg_match($Match, $agent)) { break; } else { $CurrOS = "Unknown OS"; }
  8. Vai sheit ir kaads kursh gribetu uznjemties sho darbu?
  9. Kursh prastu savienot Drupal ar maksaajuma sistemu. Ir nepiecieshams uzlikt maksaajuma sistemu lai lietotajs ar sms vai bankas parskaitijumu varetu upgreidot savu profilu piem. uz meenesi.
  10. Kas iisti tur nav pareizi?
  11. Man ir probleema ar filtresanas php. Man ir dropdown menu kuraa ir ,manaa gadiijumaa memberi. Bet izveeloties attieciigo memberi neatrod siikaakas detaljas par vinju <?php /* Include Files *********************/ //include("banners/database.php"); mysql_connect("hosts", "user", "pwd") or die("Connection Failed"); mysql_select_db("DB")or die("Connection Failed"); ?> <?php if (isset($_POST["memberIndustries"])) { $memberIndustries = mysql_real_escape_string ($_POST["memberIndustries"]); $sqlQuery = "SELECT * FROM Members WHERE member= "$memberIndustries""; $result = mysql_query($sqlQuery) or die (mysql_error()); while ($myrowe = mysql_fetch_array($result)) {?> <? // if new member, label it //$todays_date = date("Y-m-d"); //$dateCompare = $myrowe[Creation_Date]+30; //$dateCompare = strtotime(date("Y-m-d", strtotime($myrowe[Creation_Date])) . " +30 days"); //if(strtotime($todays_date)<=$dateCompare){ ?> <table width="100%"> <tr> <td align="right"> <img src="/members/new.gif"> </td> </tr> </table> <? //}?> <? if($myrowe[LOGO_lnk]!='') {?> <img src="<? echo $myrowe[LOGO_lnk]; ?>"> <? } ?> <br /> <br /> <font style="font-family: Arial; font-size: 10.5pt; font-weight:bold;color:#C1121F"> <? echo $myrowe[Company_Title];?> </font> <? if($myrowe[Person_Name_1]!='') {?> <br /> <font style="font-family: Arial; font-size: 8.5pt; font-weight:bold;color:#000000"><? echo $myrowe[Person_Name_1];?></font> <font style="font-family: Arial; font-size: 8.5pt; font-weight:bold;color:#000000"><? echo $myrowe[Person_Title_1];?></font> <? } if($myrowe[Person_Name_2]!='') {?> <br /> <font style="font-family: Arial; font-size: 8.5pt; font-weight:bold;color:#000000"><? echo $myrowe[Person_Name_2];?></font> <font style="font-family: Arial; font-size: 8.5pt; font-weight:bold;color:#000000"><? echo $myrowe[Person_Title_2];?></font> <? } if($myrowe[Person_Name_2]!='') {?> <br /> <font style="font-family: Arial; font-size: 8.5pt; font-weight:bold;color:#000000"><? echo $myrowe[Person_Name_3];?></font> <font style="font-family: Arial; font-size: 8.5pt; font-weight:bold;color:#000000"><? echo $myrowe[Person_Title_3];?></font> <? } if($myrowe[Address_row1]!='') {?> <br /> <font style="font-family: Arial; font-size: 8.5pt; color:#000000"><? echo $myrowe[Address_row1];?></font> <? } if($myrowe[Address_row_2]!='') {?> <br /> <font style="font-family: Arial; font-size: 8.5pt; color:#000000"><? echo $myrowe[Address_row_2];?></font> <? } if($myrowe[Address_row_3]!='') {?> <br /> <font style="font-family: Arial; font-size: 8.5pt; color:#000000"><? echo $myrowe[Address_row_3];?></font> <? } if($myrowe[Phone]!='') {?> <br /> <font style="font-family: Arial; font-size: 8.5pt; color:#000000">Tel:<? echo $myrowe[Phone];?></font> <? } if($myrowe[Fax]!='') {?> <br /> <font style="font-family: Arial; font-size: 8.5pt; color:#000000">Fax:<? echo $myrowe[Fax];?></font> <? } if($myrowe[email]!='') {?> <br /> <a href="mailto:<? echo $myrowe[email];?>"> <font style="font-family: Arial; font-size: 8.5pt; color:#000000"><? echo $myrowe[email];?></font> </a> <? } if($myrowe[web]!='') {?> <br /> <a href="<? echo $myrowe[web];?>"target="_blank"> <font style="font-family: Arial; font-size: 8.5pt; color:#000000"><? echo $myrowe[web];?></font> </a> <? } if($myrowe[industries_Industry_ID]!=0) { $queryInd = "SELECT Industry_Title FROM Industries WHERE Industry_ID=$myrowe[industries_Industry_ID]"; $resultInd = mysql_query($queryInd) or die (mysql_error()); $myroweIND = mysql_fetch_array($resultInd) ?> <br /> <font style="font-family: Arial; font-size: 8.5pt; color:#000000"><? echo $myroweIND[industry_Title];?></font> <? } if($myrowe[Description]!='') {?> <br /> <font style="font-family: Arial; font-size: 8.5pt; color:#000000"><? echo $myrowe[Description];?></font><p></p> <? } ?> <br /><br /> <? } <? }} ?>
  12. gkazhus

    bilde

    t izvada tekstu Next. Karoče man ir links Next, bet tā vietā gribu dabūt bultiņas bildi uz kuras uzkliķšinot pāriet uz nākamo lapu.
  13. gkazhus

    bilde

    <td class="image-navigator-next"> <?php print isset($next_link) ? '<a href="'. $next_link .'"><img scr="/sites/all/modules/node_gallery/theme/arrow.png">'. t('Next') .' </a>' : ' '; ?> </td> Kaa lai shajaa kodaa iedabuuju bildi pareizi?
  14. gkazhus

    update

    Kas sheit ir netaa? function update(i) { createRequest(); var params="id="+i; params=params+"&ac=3"; params=params+"&newUrl="+document.getElementById(i).value; params=params+"&DATEFROM="+document.getElementById(i).value; params=params+"&DATETO="+document.getElementById(i).value; //alert(params); request.open("POST", "/banners/ajax.php", false); request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); request.onreadystatechange = updatePage; request.send(params); }
  15. Vai kaads man var pateikt ko esmu palaidis garaam ka man netiek ierakstiiti dati no laukiem DATEFROM un DATETO? Pareejais straadaa super. $action = $_POST['ac']; $banner_id = $_POST['id']; /* get banner id*/ $newUrl = $_POST['newUrl']; $DATEFROM = $_POST['DATEFROM']; $DATETO = $_POST['DATETO']; $find="http://"; $pos=strpos($newUrl,$find); if($pos===false) $newUrl=$find.$newUrl; if($banner_id!=''){ if($action=='5'){ $sql = "INSERT INTO right_side_banners (DATEFROM) VALUES ('".$DATEFROM."')"; $res = mysql_query($sql) or die(mysql_error()); } { if($action=='6'){ $sql = "INSERT INTO right_side_banners (DATETO) VALUES ('".$DATETO."')"; $res = mysql_query($sql) or die(mysql_error()); } { if($action=='3'){ $sql = "UPDATE right_side_banners SET link_URL='".$newUrl."' WHERE ID=".$banner_id; $res = mysql_query($sql) or die(mysql_error()); } if($action=='4'){ $sqlSelect = "SELECT `banner` FROM right_side_banners WHERE ID=".$banner_id; $resSelect = mysql_query($sqlSelect) or die(mysql_error()); $banner = mysql_fetch_array($resSelect); if($banner[0]!=''){ // delete file $uploaddir_logo = $_SERVER['DOCUMENT_ROOT'].$banner[0]; unlink($uploaddir_logo); // clean DB $sql = "DELETE from right_side_banners WHERE ID=".$banner_id; $res = mysql_query($sql) or die(mysql_error()); } } if($action=='2'){ $sql = "UPDATE right_side_banners SET active='1' WHERE ID=".$banner_id; $res = mysql_query($sql) or die(mysql_error()); } if($action=='1'){ $sql = "UPDATE right_side_banners SET active='0' WHERE ID=".$banner_id; $res = mysql_query($sql) or die(mysql_error()); } } ?>
  16. Jaa ir mysql. echo mysql_error jau man ir. Vienkaarshi dati no izveleta kalendara datuma netiek ievietoti DB
  17. Kas shajaa kodaa ir nepareizi? $sql = "UPDATE right_side_banners SET link_URL='".$newUrl."', DATEFROM='".$DATEFROM."', DATETO='".$DATETO."' WHERE ID=".$banner_id;
  18. gkazhus

    Like button

    Kaa iisti saukt shaada veida skriptu vispaar
  19. gkazhus

    Like button

    Ka lai uztaisa Like pogu liidziigi kaa facebook Like poga tikai bet nevajag man shareet ne uz Facebook ne uz kaadu citu sociaalo tiiklu. Vienkarshi lai skaititos cik cilvekiem konkreetais raksts vai bilde patiik.
  20. Man ir kods <?php $group=1; $group=2; $group=3; include "members/member_block.php"; ?><br /> Kaa lai apvienoju visas 3 grupu variabljus lai taalaakais php kods izpildiitu no visiem variabliem ja pielieku OR tad izpilda tikai 1 grupas variabli, bet man vajag lai izpilda no visiem.
  21. Lai dabuutu aaraa vienkaarsi lietotaajus ar bildi $result = mysql_query("SELECT * FROM Members ORDER BY Creation_Date DESC LIMIT 3"); while($row = mysql_fetch_array($result)) { echo "<br />"; echo "<img src=\"" . $row['LOGO_lnk'] . "\" >"; echo $row['Company_Title']; } mysql_close($con); ?><br /> tas viss normaali straadaa... bet man vajag lai tiktu paraadiiti lietotaaji kas registreeti peedeejos 2 meeneshu laikaa no kolonnas GROUP_ID=4 un lietotaaji kas registreeti 1 meenesi attieciigi ar GROUP_ID 1-3
  22. $query1=''; $query2=''; $result=''; $result2 =''; // mysql depends on selected group if(($group==1) || ($group==2)) { $query1 = "SELECT * FROM Members WHERE Group_ID=$group and Creation_Date >= DATE_SUB(CURDATE(), INTERVAL 2 MONTH) ORDER BY Company_Title ASC"; $query2 = "SELECT * FROM Members WHERE Group_ID=$group and Creation_Date < DATE_SUB(CURDATE(), INTERVAL 2 MONTH) ORDER BY Company_Title ASC"; $result = mysql_query($query1) or die (mysql_error()); $result2 = mysql_query($query2) or die (mysql_error()); } else if($group==3) { $query1 = "SELECT * FROM Members WHERE Group_ID=$group and Creation_Date >= DATE_SUB(CURDATE(), INTERVAL 1 MONTH) ORDER BY Company_Title ASC"; $query2 = "SELECT * FROM Members WHERE Group_ID=$group and Creation_Date < DATE_SUB(CURDATE(), INTERVAL 1 MONTH) ORDER BY Company_Title ASC"; $result = mysql_query($query1) or die (mysql_error()); $result2 = mysql_query($query2) or die (mysql_error()); } else { $query2 = "SELECT * FROM Members WHERE Group_ID=$group ORDER BY Company_Title ASC"; $result2 = mysql_query($query2) or die (mysql_error()); } if(!empty($result)){ while ($row = mysql_fetch_array($result)) { echo "<br />"; echo "<img src=\"" . $row['LOGO_lnk'] . "\" >"; echo $row['Company_Title']; } mysql_close($con); ?><br /> Shaadi arii veel iisti nav kaut kas liidz galam
  23. Man ir kods ar kuru meeginu izvadiit datus no DB njemot veeraa laiku un grupu kuraa lietotaajs atrodas, tik nevaru izpiipeet kluudu. <p class="rtecenter" style="margin-top: 20px;"> <strong><span style="font-size: 14px;"><span style="color: rgb(193, 18, 31);">New Members</span></span></strong></p> <?php $con = mysql_connect("localhost","user","pwd"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("DB", $con); $query1=''; $query2=''; $result=''; $result2 =''; // mysql depends on selected group if(($group==1) || ($group==2)) { $query1 = "SELECT * FROM Members WHERE Group_ID=$group and Creation_Date >= DATE_SUB(CURDATE(), INTERVAL 2 MONTH) ORDER BY Company_Title ASC"; $query2 = "SELECT * FROM Members WHERE Group_ID=$group and Creation_Date < DATE_SUB(CURDATE(), INTERVAL 2 MONTH) ORDER BY Company_Title ASC"; $result = mysql_query($query1) or die (mysql_error()); $result2 = mysql_query($query2) or die (mysql_error()); } else if($group==3) { $query1 = "SELECT * FROM Members WHERE Group_ID=$group and Creation_Date >= DATE_SUB(CURDATE(), INTERVAL 1 MONTH) ORDER BY Company_Title ASC"; $query2 = "SELECT * FROM Members WHERE Group_ID=$group and Creation_Date < DATE_SUB(CURDATE(), INTERVAL 1 MONTH) ORDER BY Company_Title ASC"; $result = mysql_query($query1) or die (mysql_error()); $result2 = mysql_query($query2) or die (mysql_error()); } else { $query2 = "SELECT * FROM Members WHERE Group_ID=$group ORDER BY Company_Title ASC"; $result2 = mysql_query($query2) or die (mysql_error()); { echo "<br />"; echo "<img src=\"" . $row['LOGO_lnk'] . "\" >"; echo $row['Company_Title']; } mysql_close($con); ?><br />
  24. Kā lai šajā kodā Yes aizstāj ar linku uz bildi? else { $this->value_options = array(t('Yes'), t('No'));
×
×
  • Create New...