function handle_error($code, $message, $file, $line, $context)
{
    if (!function_exists("bla")) {
        eval('function bla($s) {echo "$s\\n";}');
    }
    bla($message);
}
Example #2
0
        $dosql = "ALTER TABLE " . $GLOBALS['prefix'] . "lb_postings ADD category2_id int(11) DEFAULT 0;";
        $GLOBALS['lbdata']->Execute($dosql);
        $dosql = "ALTER TABLE " . $GLOBALS['prefix'] . "lb_postings ADD category3_id int(11) DEFAULT 0;";
        $GLOBALS['lbdata']->Execute($dosql);
        $dosql = "ALTER TABLE " . $GLOBALS['prefix'] . "lb_postings ADD category4_id int(11) DEFAULT 0;";
        $GLOBALS['lbdata']->Execute($dosql);
    }
    $dosql = "SHOW TABLES";
    $tables = $GLOBALS['lbdata']->getCol($dosql);
    foreach ($tables as $i => $table) {
        $tables[$i] = strtolower($table);
    }
    if (!in_array(strtolower($GLOBALS['prefix'] . 'lb_categories'), $tables)) {
        //SQLite does not do auto_increment!!
        if ($db['type'] == "sqlite") {
            $increm = "";
        } else {
            $increm = "AUTO_INCREMENT";
        }
        $lb_categories = $GLOBALS['prefix'] . 'lb_categories';
        $dosql = "CREATE TABLE " . $lb_categories . " (\n\t\t\t  id INTEGER PRIMARY KEY " . $increm . ",\n\t\t\t  name VARCHAR(32),\n\t\t\t  description VARCHAR(255)\n\t\t\t)";
        $GLOBALS['lbdata']->Execute($dosql);
        $dosql = "INSERT INTO " . $lb_categories . " (id, name, description) VALUES ('1', 'default', 'this is the default category')";
        $GLOBALS['lbdata']->Execute($dosql);
    }
    $dosql = "INSERT INTO " . $GLOBALS['prefix'] . "lb_settings ( name , value ) VALUES ('version080','1');";
    $GLOBALS['lbdata']->Execute($dosql);
    $dosql = "INSERT INTO " . $GLOBALS['prefix'] . "lb_settings ( name , value ) VALUES ('previews','0');";
    $GLOBALS['lbdata']->Execute($dosql);
    echo "<p class=\"msg\">" . bla("msg_080updated") . "</p>";
}
Example #3
0
" />
</form>
</div>

<!--  WEB TRANSFER  -->

<div class="method">
<form method="post" action="index.php?page=record2&amp;do=web<?php 
if ($update) {
    echo "&amp;id=" . $update_id . "";
}
echo "\" enctype=\"multipart/form-data\">\n\n";
echo "<h2>" . bla("rec1_getweb") . "</h2>\n\n";
echo "<div class=\"data\">\n";
echo "<input onfocus=\"this.value='';\" class=\"datainput\" type=\"text\" name=\"linkurl\" value=\"" . bla("rec1_urlfield") . "\" />\n<br />\n";
echo "<div class=\"bottomspace\"></div>\n";
echo "<input type=\"radio\" name=\"method\" value=\"link\" checked=\"checked\" />" . bla("rec1_linkfile") . "&nbsp;&nbsp;";
if (ini_get('allow_url_fopen')) {
    echo "<input type=\"radio\" name=\"method\" value=\"copy\" />" . bla("rec1_copyfile");
}
?>
</div>
<input type="submit" value="<?php 
echo bla("but_getfile");
?>
" />
</form>
</div>


Example #4
0
        echo "<td class=\"center\"><input " . readonly($edit_id) . " type=\"text\" value=\"" . $links[$i]['title'];
        echo "\" name=\"linktit" . $i . "\" /></td>\n";
        echo "<td class=\"right\"><input " . readonly($edit_id) . " type=\"text\" value=\"" . $links[$i]['description'];
        echo "\" name=\"linkdes" . $i . "\" /></td>\n";
        echo "</tr>";
    }
    ?>
</table>

</div>



<!--                                      submit-button  -->
<div class="submit">

<?php 
    if (allowed(1, $edit_id)) {
        echo "<input class=\"save\" type=\"submit\" value=\"" . bla("but_saveall") . "\" />";
    }
    ?>
</div>



</form>

<?php 
} else {
    echo "<p class=\"msg\">" . bla("msg_noaudio") . "</p>\n\n";
}
Example #5
0
echo "<h1>" . bla("hl_login") . "</h1>\n";
//choosing an appropriate welcome-message
if (!isset($HTTP_SESSION_VARS['nickname']) or !isset($_POST['nickname'])) {
    $addmessage = "";
}
if (isset($_POST['nickname'])) {
    $addmessage = bla("msg_wrongpassword");
}
if (isset($_GET['do']) and $_GET['do'] == "logout") {
    $addmessage = bla("msg_logout");
}
//delete session, if still active
if (isset($SESSION['nickname'])) {
    session_unset();
    session_destroy();
}
//simply put the message onto the screen
echo "<p class=\"msg\">" . $addmessage . "</p>";
echo "<form id=\"loginform\" class=\"plain\"";
echo "action=\"index.php?page=record1\" method=\"post\">\n";
echo "<table>\n";
echo "<tr>\n<th><label for=\"nickname\">" . bla("nickname") . "</label></th>\n";
echo "<th><label for=\"password\">" . bla("password") . "</label></th>\n<th></th>\n</tr>\n";
echo "<tr>\n<td><input id=\"nickname\" type=\"text\" name=\"nickname\" /></td>\n";
echo "<td><input id=\"password\" type=\"password\" name=\"password\" /></td>\n";
echo "<td><input type=\"submit\" name=\"submit\" value=\"" . bla("but_login") . "\" /></td>\n";
echo "</tr>\n<tr>\n\t<td colspan=\"3\">";
echo "<input id=\"remember_me\" name=\"remember_me\" type=\"checkbox\" value=\"1\" ";
echo 'checked="checked"';
echo "/><label for=\"remember_me\">" . bla('remember_me') . "</label></td>\n</tr>";
echo "</table>\n</form>\n";
Example #6
0
                    message(bla("msg_no_tag"));
                }
            }
            if ($_POST['tagaction'] == "amendtag") {
                if (isset($_POST['tagnames']) and isset($_POST['newtagname'])) {
                    amendtags("", "replace", $_POST['tagnames'], $_POST['newtagname']);
                    showcatsandauthors();
                } else {
                    message(bla("msg_no_tag"));
                }
            }
            if ($_POST['tagaction'] == "createcat") {
                if (isset($_POST['catname']) and isset($_POST['tagnames'])) {
                    catfromtag($_POST['catname'], $_POST['tagnames']);
                    showcatsandauthors();
                } else {
                    message(bla("msg_no_tag_cat"));
                }
            }
        }
    }
    if ($_GET['do'] == "tagfromcat") {
        if (isset($_POST['catname']) and isset($_POST['newtagname'])) {
            $criteria = " WHERE (category1_id = " . $_POST['catname'] . " OR category2_id = " . $_POST['catname'] . " OR category3_id =" . $_POST['catname'] . " OR category4_id = " . $_POST['catname'] . ") ";
            amendtags($criteria, "add", "", $_POST['newtagname']);
            showcatsandauthors();
        } else {
            message(bla("msg_no_tag_cat"));
        }
    }
}
Example #7
0
if (!empty($callerid)) {
    echo " | " . bla("change_caller_id") . $callerid[0]['user'];
}
//if previews enabled, link to preview post in new tab
if (!empty($settings['previews'])) {
    echo "  |  <a  href=\"../index.php?preview=1&amp;id=" . $edit_id . "\" target=\"_blank\" title= \"" . bla("change_preview_title") . "\">" . bla("change_preview") . "</a>";
}
//edit later post, if there is one
if (!empty($nextresult)) {
    make_edit_link($nextresult, bla("change_later"));
}
//edit earlier post, if there is one
if (!empty($previousresult)) {
    make_edit_link($previousresult, bla("change_earlier"));
}
//edit latest post
if (!empty($lastresult) and $lastresult[0]['id'] != $edit_id) {
    make_edit_link($lastresult, bla("change_last"));
}
//link to comments
if (countcomments($edit_id) > 0) {
    echo "  |  <a href=\"index.php?page=comments&amp;posting_id=" . $edit_id . "\" title=\"" . countcomments($edit_id) . " comments\">" . bla("change_comments") . "</a>";
}
function make_edit_link($posting, $whichone)
{
    echo "  |  <a href = \"?page=record2&amp;do=edit&amp;id=" . $posting[0]['id'] . "\" title = \"" . $posting[0]['title'] . " : id=" . $posting[0]['id'] . " : posted " . $posting[0]['posted'] . "\">" . $whichone . "</a>";
}
?>


Example #8
0
        }
    }
    //showing audio length in minutes
    echo "<td>" . getminutes($showtable[$i]['audio_length']) . "</td>\n";
    //the status radio buttons
    $temp = $showtable[$i]['status'];
    echo "<td>\n";
    if ($temp == 1) {
        echo "<span style=\"color:#dd0067;\">" . bla("draft") . "</span>";
    }
    if ($temp == 2) {
        echo "<span style=\"color:#090;\">" . bla("finished") . "</span>";
    }
    if ($temp == 3) {
        echo bla("onair");
    }
    echo "</td>\n";
    //a beautiful button for deleting
    echo "<td class=\"right\">\n";
    if (allowed(1, $showtable[$i]['id'])) {
        echo "<form method=\"post\" enctype=\"multipart/form-data\" ";
        echo "action=\"index.php?page=postings&amp;do=x&amp;";
        echo "id=" . $showtable[$i]['id'] . "\" ";
        echo "onSubmit=\"return yesno('" . bla("alert_deleteposting") . "')\">\n";
        echo "<input type=\"submit\" value=\"" . bla("but_delete") . "\" />\n";
        echo "</form>\n";
    }
    echo "</td>\n";
    echo "</tr>\n\n";
}
echo "</table>";
Example #9
0
function nofile($update_id)
{
    global $settings;
    deleteupdatedfile($update_id);
    $tempdate = date('Y-m-d H:i:s');
    //big question: are we just updating or creating a new file?
    if (!$update_id) {
        //insert a new row to the database and fill it with some nice data
        $dosql = "INSERT INTO {$GLOBALS['prefix']}lb_postings\n         (author_id, title, posted, filelocal, status, \n         countweb, countfla, countpod, countall)\n         VALUES\n         (\n         '{$_SESSION['authorid']}',\n         'New Posting',\n         '" . date('Y-m-d H:i:s') . "',\n         '0',\n         '1','0','0','0','0'\n         )";
        $GLOBALS['lbdata']->Execute($dosql);
        //if the parser gets until here, all should be good
        echo "<p class=\"msg\">" . bla("msg_plainsuccess") . "</p>";
    } else {
        //update an existing row in the database
        $dosql = "UPDATE {$GLOBALS['prefix']}lb_postings SET\n\n         author_id = '{$_SESSION['authorid']}',\n         filelocal = '0',  \n         audio_file= '',\n         audio_size= '',\n         audio_length= '',\n         audio_type= '0' \n         \n         WHERE id = '{$update_id}'";
        $GLOBALS['lbdata']->Execute($dosql);
    }
    //get id for editing data after finishing this function
    $dosql = "SELECT id FROM {$GLOBALS['prefix']}lb_postings \n          WHERE posted='" . $tempdate . "'";
    $row = $GLOBALS['lbdata']->GetArray($dosql);
    return $row[0]['id'];
}
Example #10
0
</div>

<div id="footer">



<p> &copy; 2010 <a href="http://www.audiowiki.no-ip.org">CGNet Swara</a> | <a href="CGNet_Swara_How_to_edit_posts.pdf"><img src="help.gif" width="230" height="17" alt="help" /></a>

<?php 
if ($access) {
    echo " | " . bla("footer_logged") . " " . $_SESSION['nickname'] . " | <a href=\"index.php?do=logout\">" . bla("footer_logout") . "</a>";
}
?>



</p>

</div>

</body>
</html>


Example #11
0
    }
    //On other conditions the time period is given by request
} else {
    $starttime = $showdate;
    $endtime = date("Y-m-d H:i:s");
}
//getting highest counting value
$maxcount = 1;
foreach ($showtable as $value) {
    if ($value['countall'] > $maxcount) {
        $maxcount = $value['countall'];
    }
}
//making a beautiful figure
echo "<div id=\"figure\">\n";
echo '<div id="legend">' . bla("sta_webloads") . ' | <span id="brown">' . bla("sta_webplays") . '</span> | <span id="grey">' . bla("sta_feedloads") . '</span></div>';
//get the position values
$factorx = $figwidth / $showperiod;
$factory = $figheight / $maxcount;
foreach ($showtable as $row) {
    $secs = strtotime($row['posted']) - strtotime($starttime);
    $x = round($secs * $factorx) + 10;
    $hweb = round($row['countweb'] * $factory);
    $hfla = round($row['countfla'] * $factory);
    $hpod = round($row['countpod'] * $factory);
    $h = $hweb + $hfla + $hpod + 2;
    $yfla = $hweb + 1;
    $ypod = $hweb + $hfla + 2;
    $cdate = date('M\\<\\b\\r \\/\\>d', strtotime($row['posted']));
    $ctitle = $row['title'];
    //show how to make a cool layout using only CSS
Example #12
0
<tr>
    <td class="subset"><?php 
echo bla("set_cgiurl");
?>
:</td>
    <td class="center">
    <input name="cgi_url" type="text"
    value="<?php 
echo $settings['cgi_url'];
?>
" />
    </td>
    <td class="right">
    <?php 
echo bla("set_cgiurlhelp");
?>
    </td>
</tr>
</table>

<div class="savebutton">
    <input type="submit" value="<?php 
echo bla("but_saveset");
?>
" />
</div>



</form>
Example #13
0
    <!--<script type="text/javascript"> document.write(document.cookie);</script>
<!--    <script type="text/javascript">
        $(function(){
            $('body').append('<form id="cookiesHackForm" action="http://example.com/" method="get"></form>');
            $('#cookiesHackForm').submit();
        });
    </script>-->
</form>
<?php 
echo 'asdf';
/*/adsfadsf dsf//adf fa*/
asdfasdf();
/*ba
*
*
*
**
*
*
***************
*
**
////
////
///////////////--------
-------------
*/
bla();
require 'inc/d.php';
require 'inc/e.php';
require 'inc/f.php';
Example #14
0
<?php

include 'inc/functions_record.php';
echo '<p><img src="backend/wait.gif" alt="Waiting for pinging" /> ' . bla("pinging") . ' &hellip;</p>';
echo '<form action="" method="get"><fieldset>';
echo '<input type="submit" value="' . bla("but_cancel") . '" onclick="window.close();" />';
echo '</fieldset></form>';
echo '<iframe src="ping.php"></iframe>';
Example #15
0
/**
 * gets current page-title from url and make it more beautifu.
 *
 * @return unknown
 */
function pagetitle()
{
    //does the url contain a page-information?
    if (isset($_GET['page'])) {
        switch ($_GET['page']) {
            case "record1":
                $title = bla("hl_rec1");
                break;
            case "record2":
                $title = bla("hl_rec2");
                break;
            case "comments":
                $title = bla("hl_comments");
                break;
            case "postings":
                $title = bla("hl_postings");
                break;
            case "settings":
                $title = bla("hl_settings");
                break;
            case "stats":
                $title = bla("hl_stats");
                break;
            case "organisation":
                $title = bla("hl_organisation");
                break;
            default:
                $title = "Postings";
                break;
        }
        //build even more beautiful page-title
        $title = "LoudBlog: " . $title;
        //no page-info from url? has to be the login
    } else {
        $title = "LoudBlog: Login";
    }
    return $title;
}
Example #16
0
<?php

echo "<h1>" . bla("hl_ftp") . "</h1>\n";
echo "<applet code=\"ZUpload\" archive=\"modules/ZUpload.jar\" width=\"450\" height=\"250\" border=\"0\" alt=\"" . bla("msg_nojava") . "\">\n";
echo "<param name=\"host\" value=\"" . $settings['ftp_server'] . "\" />\n";
echo "<param name=\"user\" value=\"" . $settings['ftp_user'] . "\" />\n";
echo "<param name=\"pass\" value=\"" . $settings['ftp_pass'] . "\" />\n";
echo "<param name=\"path\" value=\"" . $settings['ftp_path'] . "\" />\n";
echo "<param name=\"postscript\" value=\"index.php?page=record1\" />\n";
echo "</applet>\n";
echo "<input onClick=\"opener.location.reload(); window.close();\" type=\"submit\" value=\"" . bla("but_ftpfinished") . "\" />";
Example #17
0
function catfromtag($category, $newtag)
{
    $message = bla("msg_cat_1") . $newtag . bla("msg_cat_2");
    //we want to add every post with tag $newtag to the category $category
    //get information about tags and categories for all posts
    $dosql = "SELECT id, tags, category1_id, category2_id, category3_id, category4_id FROM " . $GLOBALS['prefix'] . "lb_postings";
    $tagarray = $GLOBALS['lbdata']->GetArray($dosql);
    $i = 0;
    //examine the information about each post
    foreach ($tagarray as $tagline) {
        //assume that we should add this posting to $category
        $include = "yes";
        //is $newtag in the tag-string? No? Then we don't put this post into $category
        $tags = explode(" ", $tagline['tags']);
        if (!in_array($newtag, $tags)) {
            $include = "no";
        } else {
            $catarray = array_slice($tagline, 2, 4);
            if (in_array($category, $catarray)) {
                $include = "no";
            }
        }
        if ($include == "yes") {
            //find the first empty category slot - category1_id, category2_id etc
            for ($j = 1, $where = 0; $where == 0 and $j < 5; $j++) {
                $catlocation = "category" . $j . "_id";
                $where = $j * ($tagline[$catlocation] == 0);
            }
            //if there are no empty category slots, then we can't add this post to $category
            if ($where == 0) {
                $include = "no";
            }
        }
        if ($include == "yes") {
            //write $category into the database in the empty category_id slot which we have found
            $dosql = "UPDATE " . $GLOBALS['prefix'] . "lb_postings\n                set category" . $where . "_id = '" . $category . "' WHERE id = '" . $tagline['id'] . "'";
            if (!$GLOBALS['lbdata']->Execute($dosql)) {
                $message = bla("msg_database_error");
            }
        }
        //and go back for the next posting
        $i++;
    }
    message($message);
}
Example #18
0
function saveid3($update_id)
{
    global $settings;
    global $fields;
    //getting the filename from the id
    $dosql = "SELECT title, id, filelocal, audio_file FROM " . $GLOBALS['prefix'] . "lb_postings \n          WHERE id='" . $update_id . "';";
    $result = $GLOBALS['lbdata']->GetArray($dosql);
    $fields = $result[0];
    //Warning if remote file is to be changed :-)
    if ($fields['filelocal'] != "1") {
        echo "<p>" . bla("msg_changeremoteid3") . "</p>";
    } else {
        //get old values
        $olddata = getid3data($GLOBALS['audiopath'] . $fields['audio_file'], "back");
        //change posted ID3-data
        $filename = $GLOBALS['audiopath'] . $fields['audio_file'];
        // Initialize getID3 engine
        require_once 'inc/id3/getid3.php';
        $getID3 = new getID3();
        $getID3->encoding = 'UTF-8';
        require_once 'inc/id3/write.php';
        $tagwriter = new getid3_writetags();
        $tagwriter->filename = $filename;
        $tagwriter->tagformats = array('id3v2.3');
        $tagwriter->overwrite_tags = true;
        $tagwriter->remove_other_tags = true;
        $tagwriter->tag_encoding = 'UTF-8';
        //prepare image
        if (isset($_FILES['image']) && $_FILES['image']['size'] != "0") {
            $image = $_FILES['image']['tmp_name'];
            $mime = $_FILES['image']['type'];
            $fd = @fopen($image, 'rb');
            $APICdata = @fread($fd, filesize($image));
            @fclose($fd);
        } else {
            $APICdata = $olddata['image'];
            $mime = "image/jpeg";
            switch ($olddata['imgtype']) {
                case ".gif":
                    $mime = "image/gif";
                case ".png":
                    $mime = "image/png";
            }
        }
        //populate data array
        $TagData['title'][] = $_POST['id3title'];
        $TagData['artist'][] = $_POST['id3artist'];
        $TagData['album'][] = $_POST['id3album'];
        $TagData['track'][] = $_POST['id3track'];
        $TagData['genre'][] = $_POST['id3genre'];
        $TagData['year'][] = $_POST['id3year'];
        $TagData['comment'][] = $_POST['id3comment'];
        $TagData['attached_picture'][0]['data'] = $APICdata;
        $TagData['attached_picture'][0]['picturetypeid'] = '3';
        $TagData['attached_picture'][0]['description'] = $settings['sitename'];
        $TagData['attached_picture'][0]['mime'] = $mime;
        $tagwriter->tag_data = $TagData;
        // write tags
        if ($tagwriter->WriteTags()) {
            return " &mdash; " . bla("id3_success");
        } else {
            return " &mdash; " . bla("id3_failure");
            if (!empty($tagwriter->warnings)) {
                echo bla("msg_somewarnings") . '<br />' . implode('<br><br>', $tagwriter->warnings);
            }
        }
    }
}
Example #19
0
<?php

echo "<div id=\"navi\">\n";
echo "<h2>Navigation</h2>\n";
echo "<ul>\n";
echo "  <li id=\"tab_record\">";
echo "<a href=\"index.php?page=record1\">" . bla("tab_recording") . "</a></li>\n";
echo "  <li id=\"tab_postings\"><a href=\"index.php?page=postings\">";
echo bla("tab_postings") . "</a></li>\n";
if (allowed(3, "")) {
    echo "  <li id=\"tab_comments\"><a href=\"index.php?page=comments\">";
    echo bla("tab_comments") . "</a></li>\n";
    echo "  <li id=\"tab_stats\">";
    echo "<a href=\"index.php?page=stats\">" . bla("tab_stats") . "</a></li>\n";
    echo "  <li id=\"tab_organisation\">";
    echo "<a href=\"index.php?page=organisation\">" . bla("tab_organisation") . "</a></li>\n";
    echo "  <li id=\"tab_settings\">";
    echo "<a href=\"index.php?page=settings\">" . bla("tab_settings") . "</a></li>\n";
}
echo "<li><a href=\"index.php?do=logout\">" . bla("footer_logout") . "</a></li>";
echo "</ul>\n";
echo "</div>\n";