function innerHTML(&$xml, $nodeName)
{
    $nodes = $xml->getElementsByTagName($nodeName);
    if ($nodes->getLength() > 0) {
        $node = $nodes->item(0);
        eregi("<{$nodeName}>(.*)<\\/{$nodeName}>", $node->toString(), $matches);
        // replace invalid <c> with <kbd>
        $string = str_replace(array('<c>', '</c>'), array('<kbd>', '</kbd>'), $matches[1]);
        if (substr($string, 0, 1) == "\n") {
            $string = substr($string, 1);
        }
        return trim(chars($string));
    } else {
        return false;
    }
}
Example #2
0
File: init.php Project: s1kartik/s1
function makeLinkHref($l)
{
    global $pageURL, $pageTitles, $bot, $nojsuser;
    if ($l == "") {
        return "";
    }
    if (substr($l, 0, 9) == 'external:' || substr($l, 0, 9) == 'gotolink:') {
        return substr($l, 9);
    }
    if (substr($l, 0, 7) == "http://" || substr($l, 0, 8) == "https://" || substr($l, 0, 1) == "/" || substr($l, 0, 1) == "#" || $l[strlen($l) - 1] == "/") {
        return $l;
    }
    if (array_key_exists($l, $pageURL)) {
        $lu = strtolower(chars($pageURL[$l]));
    } else {
        $lu = strtolower(chars("url=" . $l));
    }
    if ($bot && !$nojsuser) {
        return "#!/" . stripSpaces($lu);
    } else {
        return "?p=" . stripSpaces($lu);
    }
}
 //title
 echo "    <title>" . chars($fields['title']) . " (Comment #" . $i . ")</title>\n";
 //link
 echo "    <link>" . $settings['url'] . "/index.php?id=" . $fields['id'] . "#com" . $comfields['id'] . "</link>\n";
 //show categories
 showcats($fields);
 //commentator's name
 $author = chars($comfields['name']);
 echo "    <dc:creator>" . $author . "</dc:creator>\n";
 echo "    <itunes:author>" . $author . "</itunes:author>\n";
 //description
 $mess = chars($comfields['message_html']);
 echo "    <description>\n" . $mess . "\n    </description>\n";
 echo "    <itunes:summary>\n" . $mess . "\n    </itunes:summary>\n";
 //bodytext
 echo "    <content:encoded>\n" . chars($comfields['message_html']);
 //preparing some variables
 $audiourl = $settings['url'] . "/audio/" . $comfields['audio_file'];
 if ($comfields['audio_file'] == "") {
     $audiothere = false;
 } else {
     $audiothere = true;
 }
 $tmp = "";
 //do we have an audio file? link to it here!
 if ($audiothere) {
     $tmp .= "<p><a href=\"{$audiourl}\">Audio Download ";
     $tmp .= "(" . getminutes($comfields['audio_length']) . " min / " . getmegabyte($comfields['audio_size']) . " MB)</a>";
 }
 echo trim(htmlspecialchars($tmp, ENT_QUOTES));
 echo "    </content:encoded>\n";
Example #4
0
File: seo.php Project: s1kartik/s1
 /* Get the page he wants from the url */
 /*Fake our menu for crawling*/
 $links = "<a class='subNavItem' style='background-color:#C33;' href='#!'>" . $l_home . "</a>";
 foreach ($pageTitles as $i => $name) {
     $links .= "<a class='subNavItem' style='background-color:#C33;' href=#!/" . str_replace(" ", "-", $name) . ">" . $name . "</a>";
 }
 if ($page == "" || $page == "home") {
     $reqUrl = "";
     $siteTitle = $siteTitle . " | " . $siteTitleHome;
 } else {
     if (substr($page, 0, 4) == "url=" && file_exists("pages/" . strtolower(substr($page, 4)))) {
         $reqUrl = strtolower(substr($page, 4));
         $siteTitle = $reqUrl . " | " . $siteTitle;
     } else {
         foreach ($pageURL as $url => $pageURLs) {
             if (strtolower(chars($pageURLs)) == strtolower(chars($page))) {
                 $reqUrl = $url;
                 $siteTitle = $pageTitles[$url] . " | " . $siteTitle;
                 break;
             }
         }
         if ($reqUrl == "") {
             if (file_exists("pages/" . strtolower($page) . ".php")) {
                 $reqUrl = strtolower($page) . ".php";
                 $siteTitle = $page . " | " . $siteTitle;
             } else {
                 $reqUrl = "pagenotfound";
             }
         }
         if (isset($pageDescriptions[$reqUrl])) {
             $siteMetaDesc = $pageDescriptions[$reqUrl];
Example #5
0
 /* Get the page he wants from the url */
 /*Fake our menu for crawling*/
 $links = "<a class='subNavItem' style='background-color:#C33;' href='#!'>Home</a>";
 foreach ($pageTitles as $i => $name) {
     $links .= "<a class='subNavItem' style='background-color:#C33;' href=#!/" . str_replace(" ", "-", $name) . ">" . $name . "</a>";
 }
 if ($page == "" || $page == "home") {
     $reqUrl = "";
     $siteTitle = $siteTitle . " | " . $siteTitleHome;
 } else {
     if (substr($page, 0, 4) == "url=" && file_exists("pages/" . strtolower(substr($page, 4)))) {
         $reqUrl = strtolower(substr($page, 4));
         $siteTitle = $reqUrl . " | " . $siteTitle;
     } else {
         foreach ($pageTitles as $url => $pageTitle) {
             if (strtolower(chars($pageTitle)) == strtolower(chars($page))) {
                 $reqUrl = $url;
                 $siteTitle = $pageTitle . " | " . $siteTitle;
                 break;
             }
         }
         if ($reqUrl == "") {
             if (file_exists("pages/" . strtolower($page) . ".php")) {
                 $reqUrl = strtolower($page) . ".php";
                 $siteTitle = $page . " | " . $siteTitle;
             } else {
                 $reqUrl = "pagenotfound";
             }
         }
     }
 }
/**
 * badwords
 *
 * @text string 
 */
function badwords($text)
{
    global $data;
    $ctcensorword = explode(",", $data["badwords"]);
    while (list($key, $val) = each($ctcensorword)) {
        if ($val != "") {
            if (substr($val, 0, 1) == "{") {
                $val = substr($val, 1, -1);
                $text = trim(eregi_replace("([^A-Za-z])" . $val . "([^A-Za-z])", "\\1" . chars("*", strlen($val)) . "\\2", " {$text} "));
            } else {
                $text = trim(eregi_replace($val, chars("*", strlen($val)), " {$text} "));
            }
        }
    }
    return $text;
}
Example #7
0
        function getMarginTop($group)
        {
            return 45;
        }
    }
}
/* For DATA arguments */
function posVal($marginTop, $marginLeft, $width)
{
    echo " data-pos='" . str_replace(".", "_", $marginTop . "-" . $marginLeft . '-' . $width) . "' ";
}
/* Generates tile titles  */
foreach ($groupTitles as $l => $title) {
    ?>
    <a href="#&amp;<?php 
    echo strtolower(chars(str_replace(" ", "-", $title)));
    ?>
" id="groupTitle<?php 
    echo $l;
    ?>
" class="groupTitle" style="margin-left:<?php 
    echo getMarginLeft($l);
    ?>
px; margin-top:<?php 
    echo getMarginTop($l) - 45;
    ?>
px" onclick="javascript:$group.goTo(<?php 
    echo $l;
    ?>
);"><h3><?php 
    echo $title;
Example #8
0
                $pdf_data['author'] = XoopsUser::getUnameFromId($pm[$i]->getVar('from_userid'));
                $pdf->AddPage();
                $pdf->SetFont('Arial', 'B', 15);
                $w = $pdf->GetStringWidth($pdf_data['title']) + 6;
                $pdf->SetX((210 - $w) / 2);
                $pdf->SetDrawColor(204, 204, 204);
                $pdf->SetFillColor(0, 0, 0);
                $pdf->SetLineWidth(0.2);
                $pdf->SetTextColor(255, 255, 255);
                $pdf->Cell($w, 8, Chars($pdf_data['title']), 1, 1, 'C', true);
                $pdf->Ln(6);
                // date
                $pdf->SetFont('Arial', '', 8);
                $pdf->SetTextColor(0, 0, 0);
                $pdf->SetFillColor(255, 255, 255);
                $pdf->MultiCell(40, 8, chars(_MP_TRI_DATE) . ': ' . $pdf_data['date'], 1, 1, 'L', true);
                $pdf->Ln(6);
                $pdf->SetFont('Arial', '', 8);
                $pdf->SetFillColor(239, 239, 239);
                $pdf->MultiCell(190, 10, $pdf_data['content'], 1, 1, 'C', true);
                $pdf->Ln(4);
                $pdf->SetFillColor(255, 255, 255);
                $pdf->MultiCell(190, 10, _MP_FROM2 . " : " . $pdf_data['author'], 1, 1, 'C', true);
                $pdf->Ln(4);
            }
            break;
    }
}
$pdf->Output();
function Chars($text)
{