コード例 #1
0
ファイル: language.php プロジェクト: holandacz/nb4
     }
 }
 $phrasetypeoptions = array();
 $phrasetypes = fetch_phrasetypes_array();
 foreach ($phrasetypes as $fieldname => $type) {
     $phrasetypeoptions["{$fieldname}"] = $type['title'];
 }
 print_phrase_ref_popup_javascript();
 // get custom phrases
 $numcustom = 0;
 if ($vbulletin->GPC['dolanguageid'] != -1) {
     $custom_phrases = fetch_custom_phrases($vbulletin->GPC['dolanguageid'], $vbulletin->GPC['fieldname']);
     $numcustom = sizeof($custom_phrases);
 }
 // get inherited and customized phrases
 $standard_phrases = fetch_standard_phrases($vbulletin->GPC['dolanguageid'], $vbulletin->GPC['fieldname'], $numcustom);
 $numstandard = sizeof($standard_phrases);
 $totalphrases = $numcustom + $numstandard;
 $numpages = ceil($totalphrases / $perpage);
 if ($vbulletin->GPC['pagenumber'] < 1) {
     $vbulletin->GPC['pagenumber'] = 1;
 }
 if ($vbulletin->GPC['pagenumber'] > $numpages) {
     $vbulletin->GPC['pagenumber'] = $numpages;
 }
 $startat = ($vbulletin->GPC['pagenumber'] - 1) * $perpage;
 $endat = $startat + $perpage;
 if ($endat >= $totalphrases) {
     $endat = $totalphrases;
 }
 $i = 15;
コード例 #2
0
ファイル: phrase.php プロジェクト: holandacz/nb4
    $phrasetypes = fetch_phrasetypes_array();
    foreach ($phrasetypes as $fieldname => $type) {
        $typeoptions["{$fieldname}"] = $type['title'] . ' ' . $vbphrase['phrases'];
    }
    define('NO_PAGE_TITLE', true);
    print_cp_header("{$vbphrase['quickref']} {$langoptions["{$vbulletin->GPC['languageid']}"]} {$typeoptions["{$vbulletin->GPC['fieldname']}"]}", '', '', 0);
    $phrasearray = array();
    if ($vbulletin->GPC['languageid'] != -1) {
        $custom = fetch_custom_phrases($vbulletin->GPC['languageid'], $vbulletin->GPC['fieldname']);
        if (!empty($custom)) {
            foreach ($custom as $phrase) {
                $phrasearray[htmlspecialchars_uni($phrase['text'])] = $phrase['varname'];
            }
        }
    }
    $standard = fetch_standard_phrases($vbulletin->GPC['languageid'], $vbulletin->GPC['fieldname']);
    if (is_array($standard)) {
        foreach ($standard as $phrase) {
            $phrasearray[htmlspecialchars_uni($phrase['text'])] = $phrase['varname'];
        }
        $tval = $langoptions["{$vbulletin->GPC['languageid']}"] . ' ' . $typeoptions["{$vbulletin->GPC['fieldname']}"];
    } else {
        $tval = construct_phrase($vbphrase['no_x_phrases_defined'], '<i>' . $typeoptions["{$vbulletin->GPC['fieldname']}"] . '</i>');
    }
    $directionHtml = 'dir="' . $languages["{$vbulletin->GPC['languageid']}"]['direction'] . '"';
    print_form_header('phrase', 'quickref', 0, 1, 'cpform', '100%', '', 0);
    print_table_header($vbphrase['quickref'] . ' </b>' . $langoptions["{$vbulletin->GPC['languageid']}"] . ' ' . $typeoptions["{$vbulletin->GPC['fieldname']}"] . '<b>');
    print_label_row("<select size=\"10\" class=\"bginput\" onchange=\"\n\t\tif (this.options[this.selectedIndex].value != '')\n\t\t{\n\t\t\tthis.form.tvar.value = '\$" . "vbphrase[' + this.options[this.selectedIndex].text + ']';\n\t\t\tthis.form.tbox.value = this.options[this.selectedIndex].value;\n\t\t}\n\t\t\">" . construct_select_options($phrasearray) . '</select>', '
		<input type="text" class="bginput" name="tvar" size="35" class="button" /><br />
		<textarea name="tbox" class="darkbg" style="font: 11px verdana" rows="8" cols="35" ' . $directionHtml . '>' . $tval . '</textarea>
		');