Jump to content

rastaman46

Members
  • Posts

    58
  • Joined

  • Last visited

Posts posted by rastaman46

  1. Hey again well

     

    im trying to call 2 tables from sql "t1" content name "t2" got all records im matching them up by ID

     

    but result im get its row me in single rows Same name comes up few times diferent info same name

     

    but i need if name is same and have few recods im like to display like this

     

    "Name"-->first-->second-->and so on

     

    not like

     

    "Name" --> first

    "Name" --> second

    "Name" -->and so on

     

    did im was clear???

  2. Yes its array

     

    foreach ($returnStats['listener'] as $listener)

    {

    $listeners['LISTENERS'] = array(

    'HOSTNAME' => (string) $listener->HOSTNAME,

    'USERAGENT' => (string) $listener->USERAGENT,

    'CONNECTTIME' => (string) $listener->CONNECTTIME,

    'POINTER' => (string) $listener->POINTER,

    'UID' => (string) $listener->UID,

    );

    echo $listeners['LISTENERS']['HOSTNAME'];

     

    }

  3. Im noob on arrays so please help people

     

    here is output im get

    Array ( [fieldType] => input [config] => Array ( [setting] => 10 [setting1] => 20 ) ) 

     

    how to im get value in PHP variable im tryd

     

    "$config['setting']"  but get me nothing

     

    [fieldType] => input [config]  call me field do works but not rest

     

    Please just guid me up im beginning in this world!!!

  4. got this code but struggling to get php side working dont know how php have to look like please help or advise me thanks!!!

     

    $('#create_shout').submit(function(e)
    {
    e.preventDefault();
    
    var 
    $message = $.TSUE.urlEncode(tinyMCE.activeEditor.getContent());
    
    if($message === '')
    {
    	$.TSUE.alert(TSUEPhrases['message_required_fields_error']);
    	return false;
    }
    
    buildQuery = 'action=create_shout&message='+$message+'&securitytoken='+TSUESettings['stKey'];
    $.ajax(
    {
    	url:TSUESettings['website_url']+'/ajax/shoutpost_ajax.php',
    	data: buildQuery,
    	success: function(serverResponse)
    	{
    		if(!$.TSUE.findresponsecode(serverResponse))
    		{
    			$.TSUE.alert(TSUEPhrases['message_posted']);
    			$.TSUE.jumpInternal('?p=shoutpost&pid=502');
    			return false;
    		}
    		else
    		{
    			$.TSUE.dialog(serverResponse);
    		}
    	}
    })
    });

     

    and php

     

    function create_shout(){
    $date = TIMENOW;
    $memberid = $TSUE['TSUE_Member']->info['memberid'];
    $message = addslashes($_POST['message']);
    $add = $TSUE['TSUE_Database']->query("INSERT INTO `rasta_shout_post`(`sid`, `date`, `memberid`, `message`) VALUES ('','$date','$memberid','$message')");
    }

  5. Hello got some problems with it if im change to "preg_replace its just stop working my php version is 5.3.10

     

    Please help

     

    $loop = array("AVERAGETIME", "CURRENTLISTENERS", "PEAKLISTENERS", "MAXLISTENERS", "SERVERGENRE", "SERVERURL", "SERVERTITLE", "SONGTITLE", "SONGURL", "IRC", "ICQ", "AIM", "WEBHITS", "STREAMHITS", "LISTEN", "STREAMSTATUS", "BITRATE", "CONTENT");
    $y=0;
    while($loop[$y]!=''){
      $pageed = ereg_replace(".*<$loop[$y]>", "", $page);
      $scphp = strtolower($loop[$y]);
      $$scphp = ereg_replace("</$loop[$y]>.*", "", $pageed);
    // uncomment the next line to see all variables
    //echo'$'.$scphp.' = '.$$scphp.'<br>';
      $y++;
    }
    

  6. 70050061.jpg

     

    The green shows up for all not submitted  but imn have just placed bet just for one of them but rest still comes with message (Im not bet them yet)

     

    Maybe im ruining sql wrong??

     

    here full code

     

    <?php
    /*
    This page coded by rastaman46 special for www.tsue-themes.net
    */
    
    //Required for Active Members / Last 24 Active Members Plugins
    define('SCRIPTNAME', 'betting.php');
    
    //Load templates for this page to avoid extra usage of SQL queries.
    $LoadTemplatelist = array('betting');
    
    //Init
    require('./library/init/init.php');
    
    //Set Page Title
    $Page_Title = get_phrase('betting');
    
    //Create & Add Breadcrumb
    AddBreadcrumb(array
    (
    get_phrase('navigation_home') => $TSUE['TSUE_Settings']->settings['global_settings']['website_url'].'/?p=home&pid=1',
    get_phrase('betting') => $TSUE['TSUE_Settings']->settings['global_settings']['website_url'].'/?p=betting&pid='.PAGEID
    ));
    $ratio = number_format($TSUE['TSUE_Member']->info["uploaded"] / $TSUE['TSUE_Member']->info["downloaded"], 2);
    
    // here all begins
    $memberid = '';
    $statymai ='';
    $forma = '';
    $statom = $TSUE['TSUE_Database']->query("SELECT count(*), b.betid, a.betid, a.memberid, a.chosen_team FROM rasta_betters a, rasta_betting b  WHERE memberid = ".$TSUE['TSUE_Member']->info["memberid"]." AND b.betid = a.betid ");       
    	 $arr = mysqli_fetch_array($statom);	  
    $bets = $TSUE['TSUE_Database']->query("SELECT betid, bet_name, user_id, team1, team2, start, finish, image1, image2 FROM rasta_betting ");       
    	 while ($row = $TSUE['TSUE_Database']->fetch_assoc($bets)) {
    	 $betting_rezults = '';
    	 $betting_form = '';
    	 $betid = $row['betid'];
    	 $finish = $row['finish'];
    	 $laikas = TIMENOW;
    	 $komanda = $row['team1'];
    	 $komanda2 = $row['team2'];
    	 $bet_name = $row['bet_name'];
    	 $userid = $row['user_id'];			 
             $image1 = $row['image1'];
             $image2 = $row['image2'];
    	 $forma = '';	
    
             if($ratio < 1)
    	 {
    	 $forma = '<div class="error" id="show_error">Your ratio is to low to place Bet</div>';
    	 }
    	 elseif ($laikas > $finish)
    	 {
    	 $forma = '<div class="error" id="show_error">This bet Hase been ended</div>';
    	 }
    
         elseif ($laikas > $finish)
    	 {
    	 $team1 = $row['team1'];
    	 $team2 = $row['team2'];
    	 $komanda = '';
    	 $komanda = $team1;
    	 $komanda2 = '';
    	 $komanda2 = $team2;
    	 } 
             elseif ($arr[0] > 0) 
    	 {
    	 $forma = '<div class="success">You have placed bet here</div>';
    	 }
    	 else{			 
    	 $team1 = $row['team1'];
    	 $team2 = $row['team2'];
    	 $pisk = '<input type="checkbox" name="komanda" value="'.$team1.'" />';
    	 $pisk2 = '<input type="checkbox" name="komanda" value="'.$team2.'" />';
    	 $komanda = '';
    	 $komanda = $team1.$pisk;
    	 $komanda2 = '';
    	 $komanda2 = $team2.$pisk2;
    	 $forma =  'This bet end on:'. date('Y-m-d H:i:s',$row['finish']).'';
             eval("\$betting_form = \"".$TSUE['TSUE_Template']->LoadTemplate('betting_form')."\";");
    	 $forma .= $betting_form;
    	 }	 
             eval("\$betting_rezults = \"".$TSUE['TSUE_Template']->LoadTemplate('betting_rezults')."\";");
        $statymai .= $betting_rezults;
    
    }
    
    
    if (isset($_POST['placebet']))
    {
    $statymo_dydis = '';
    $statymo_dydis = 1073741824;
    $suma = $_POST['suma'];
    $statoma = $suma * $statymo_dydis;
    $vartotojas = $TSUE['TSUE_Member']->info["memberid"];
    $komanda = $_POST['komanda'];
    $betid =$_POST['betid'];
    $kada = TIMENOW;
    $irasom = $TSUE['TSUE_Database']->query("INSERT INTO `rasta_betters`(betterid, betid, memberid, chosen_team, bett, added) VALUES ('','$betid','$vartotojas','$komanda','$statoma','$kada')");
    
          $test ='';
      $test = '<div class="information" id="show_information">Bet hase been placed.</div>';
      $naujinam =	$TSUE['TSUE_Database']->query("update tsue_member_profile set uploaded=uploaded-'$statoma' where memberid=".$TSUE['TSUE_Member']->info["memberid"]."");
    }
    
    //Get Page Template
    eval("\$betting = \"".$TSUE['TSUE_Template']->LoadTemplate('betting')."\";");
    //Print HTML Output
    PrintOutput($betting, $Page_Title);
    ?>

  7. Thanks for reply im want to do when user have submitted bet its stops displaying submit form

     

    way im got now is once im submit bet all other bets comes with message but im want display message just for submitted one  bcoz its record user id in sql

     

    i can post full code if need to

  8. Hello needed for permissions

     

    well dont know even how to ask .

     

    im building simple betting and im want to add message if user has submitted bet

     

    but problem im got is once user submit all other bets comes with message how to make it work separate for every single row

     

    Here is my code

     

    $statom = $TSUE['TSUE_Database']->query("SELECT count(*), b.betid, a.betid, a.memberid, a.chosen_team FROM rasta_betters a, rasta_betting b  WHERE memberid = ".$TSUE['TSUE_Member']->info["memberid"]." AND b.betid = a.betid ");       
    	 $arr = mysqli_fetch_array($statom);
                     if ($arr[0] > 0) 
    	 {
    	 $forma = '<div class="success">You have placed bet here</div>';
    	 }
    	 else{			 
    	 $team1 = $row['team1'];
    	 $team2 = $row['team2'];
    	 $pisk = '<input type="checkbox" name="komanda" value="'.$team1.'" />';
    	 $pisk2 = '<input type="checkbox" name="komanda" value="'.$team2.'" />';
    	 $komanda = '';
    	 $komanda = $team1.$pisk;
    	 $komanda2 = '';
    	 $komanda2 = $team2.$pisk2;
    	 $forma =  'This bet end on:'. date('Y-m-d H:i:s',$row['finish']).'';
             eval("\$betting_form = \"".$TSUE['TSUE_Template']->LoadTemplate('betting_form')."\";");
    	 $forma .= $betting_form;
    	 }	 
    

     

    $TSUE['TSUE_Member']->info["memberid"] that is actual user id gets id auto

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.