adiman-dev / Mathurat

A text-based Mathurat library
Other
19 stars 9 forks source link

English Translation #2

Closed iwanikhalid closed 3 years ago

iwanikhalid commented 8 years ago

I will be doing this soonish insyaAllah

Refs

adiman-dev commented 8 years ago

I have converted your .txt file to .sql file

iwanikhalid commented 8 years ago

Orait sorry tak sempat habiskan lagi. Nak cari the right translation challenging skek

adiman-dev commented 8 years ago

No worries. Takde rush nak kemana pon :P

iwanikhalid commented 8 years ago

Hehehe hey can you help me with PHP

$values = get_field('reviewer');
if($values)
{
    echo '<ul>';
    foreach($values as $value)
    {
        echo '<li>' . $value['display_name'] . '</li>';
    }
    echo '</ul>';
}

Macam mana I nak tukar li tu ke list biasa dengan comma je.

Now it appears like

I just want Result 1, Result 2, Result 3

adiman-dev commented 8 years ago
values = get_field('reviewer');
if($values)
{
    foreach($values as $value) {
        $display .= $value['display_name'] . ‘, ’;
}
    echo substr($display, 0, -2);
}

Sorry lambat reply. Dunno if you already solve it but here goes

adiman-dev commented 8 years ago

oh why dia ilang semua indent???

:/

iwanikhalid commented 8 years ago

Haha I tulis kat notepad++ and copy paste here

Anyway, the code below didn't seem to work. Tak keluar apa2

$values = get_field('reviewer'); 
if($values) { 
    foreach($values as $value) { 
        $display .= $value['display_name'] . ', '; 
    } 
    echo substr($display, 0, -2); 
}
adiman-dev commented 8 years ago

i dah fix the code. tatau la kalau tak jadi gak. ekceli tadi silap += sepatutnya .=

iwanikhalid commented 8 years ago

Yayy dah work. But then results dia repeating plak eg:

Reviewer(s): Trudie Roberts, Trudie Roberts

Reviewer(s): Trudie Roberts, Trudie Roberts, Richard Hays, Trudie Roberts, Jim McKillop, Mafauzy Mohamed

Any idea why? Kalau tak, I'm just going to use ul li methinks

adiman-dev commented 8 years ago

repeating tu sebab your loop je tu. check the loop

iwanikhalid commented 8 years ago

Yayyyyyyyyyyyy I solved it!

$values = get_field('reviewer');                                        
$last = count($values) - 1;
foreach ($values as $i => $row)
{                                               
    //$isFirst = ($i == 0);                             
    $isLast = ($i == $last);                                                    
    if($isLast) :
        echo ''. $row['display_name'];
    else :
        echo $row['display_name'].', ';
    endif ;                                         
}
adiman-dev commented 7 years ago

@iwanikhalid u still alive?

adiman-dev commented 3 years ago

Closing issue. If anybody can continue where @iwanikhalid left off, is very much appreciated