05 Temmuz 2009, 23:06:51
Mustafa Kemal Atatürk -Adanalı Dizisi -KVP Bölümleri -KVP Müzikleri -Full Programlar -Albümler -Online Dizi İzle -Online Film İzle
Dizi Müzikleri -Dizi Özetleri & Fragmanları -Diziler -Filmler -SW Aktiviteleri -Şiirler -Tiny Portal -Full Oyun Download

Saygı değer Üyelerimiz sitemiz bir forum sitesi olduğu için kullanıcılar her türlü görüşlerini önceden onay olmadan anında siteye yazabilmektedir, bu yazılardan dolayı doğabilecek her türlü sorumluluk yazan kullanıcılara aittir. T.C. Kanunlarına aykırı olan MP3,Warez,Crack,Flim V.b. ürünlerin sitemizde paylaşımı Kesin olarak Yasaktır. Kurallara uymayan üyeler sitemizden uzaklaştırılır ve gerektiğinde yasal kurumlarda kullanılmak üzere IP (Internet Kimlik Numarası)adresi verilecektir.

Sayfa: [1]   Aşağı git
Yazdır
Gönderen Konu: Custom Page (tp bloc)  (Okunma Sayısı 393 defa)
alp
Admin
******

Rep 144
Çevrimdışı Çevrimdışı

Mesaj Sayısı: 8,455



WWW
« : 28 Ekim 2007, 09:55:29 »

Custom Page (kişisel sayfa)
portalınız ayarladığınız yerde bunun gibi bir kişisel sayfa imkanı verir
Linklerin Görülmesine İzin Verilmiyor
Linki Görebilmek İçin Üye Ol veya Giriş Yap
boyutlarını ayarlayabiliyorsunuz

oluşan sayfanın boyutunun ayarları için bunları değiştirin
Kod:
$cp_width = "100%";
$cp_height = 600;

php blok oluşturun bu kodu yapıştırın.
Kod:
//////////////////////////////////////////////
// Custom Page 1.05
// Developed by Thurnok
// Complete Computer Services
// August 27, 2006
//
// Last updated - January 27, 2007
// - fix for PHP 5.x
//
// Custom Page allows you to give your users the ability to display
// a page of their choice in a centerblock or article based on their User ID.
// This project was developed due to a request on TinyPortal site for
// a centerblock that would display the currently logged in user's
// myspace site.
//
// This version allows your members to choose whether to allow other members
// to view their custom page or not.  Other members can use a pulldown to select
// a member that has their custom page set to public and hence view that member's page.
// It also updates your custompage table to accommodate this automatically.
//
// This script will create a table for the custom page using your current
// SMF table prefix followed by custompage (ex: smf_custompage) and using your
// current database credential information.
// NOTE: Your database user/permissions used for SMF must allow you to
// create a table or you will never be able to store the info.  You
// can create the table manually if necessary.
//
// Also note that a mysql connection is already alive and so creating a new connection
// and closing it is undesirable and causes problems in other blocks.  Therefore,
// you will notice the absence of mysql_connect() and mysql_close() functions
// used in this snippet.
//////////////////////////////////////////////

// User Configurable items

//   *****   LAYOUT OPTIONS   *****
// an IFRAME is necessary to keep the page "within" your site
// width and height of the IFRAME in your center block
$cp_width = "100%";
$cp_height = 600;

//   *****   SECURITY CONFIGURATION   *****
// Groups allowed to select and set their custom page
// This is in the form of their Group ID - example: array('3', '6', '9');
$cp_allowed_groups = array('');
// individual members not allowed to use even if in an allowed group
// uses the member ID - example: array('91', '16');
$cp_disallowed_members = array('');
// whether or not to allow users to make their site public
$cp_allow_public = true;

//   *****   DEFAULT STUFF   *****
// if the user is not allowed, or doesn't have a custom page yet, what
// page do you want to display to them in the IFRAME?
$cp_default_page = "http://www.google.com";

// whether to display the default page if not allowed or no page yet (set to a true value)
// or to not display any page in the block, only the form (set to a false value)
$cp_display_default = 1;

// if $cp_display_default = 0 (or some false value), and user doesn't have a page set,
// display this default text where the IFRAME would have been
$cp_default_text = "You currently do not have a custom page selected.<br />
Please use the form below to select a page.<br />
If you do not see the form below, it is because you do not have access to create a custom page.";

// you can set the tablename to other than custompage if you like
$cp_tablename = "custompage";
// and the title displayed
$cp_title = "Custom Page!";
// add some descriptive text here if you like to display under title
$cp_desc = "Your MySpace right here!  Use the form below to set your custom page.";

// if user's browser does not support IFRAMEs, display this where it would be
$cp_no_iframe = "<h1>Custom Page!</h1>
Your browser does not support IFRAMEs.  You should get a better browser to see what you are missing!<br />
Check out Mozilla or Firefox, they are great!<br />";


// Print our title - or comment the line to not display a title
echo '<center><b>' . $cp_title . '</b></center><br />';
echo '<font size=1>' . $cp_desc . '</font><p />';

//////////////////////////////////////////////
//
// The rest of this you should leave as is
// unless you are overly industrious :)
//
//////////////////////////////////////////////
// globals for database vars
global $db_prefix;
// globals for user information
global $context, $user_info, $ID_MEMBER;

$cp_id = $ID_MEMBER;
$cp_admin = false;

// set up all our functions ahead of time
// function to create table if not already there
function CustomPageCreateTable($cp_tablename) {
// set up the query that will create the table appropriately
$dbquery = "CREATE table $cp_tablename (id INT UNSIGNED NOT NULL PRIMARY KEY,
url TEXT, public tinyint(1) NOT NULL default '0', selected_user INT UNSIGNED);";
if (!mysql_query($dbquery)) {
die("Query Failed!  Table NOT Created!<br />\n");
}
}

// function to modify table to add "public" and "selected_user" columns
function CustomPageModifyTable($cp_tablename) {
// set up the query that will modify the table appropriately
$dbquery = "ALTER TABLE $cp_tablename ADD (public tinyint(1) NOT NULL default '0', selected_user INT UNSIGNED);";
if (!mysql_query($dbquery)) {
if (mysql_errno() == 1060){
// just a double precaution as part of the NULL fix :)
} else {
die("Query Failed!  Table NOT Modified!<br />\n" . mysql_errno() . ": " . mysql_error());
}
}
}

// function to add/edit a user and their custom page to/in the table
function CustomPageAdd($cp_tablename, $cp_id, $cp_url, $cp_selected_user, $cp_public=0) {
if ($cp_url != ''){
if (strtolower(substr($cp_url, 0, 7)) != "http://"){
$cp_url = "http://" . $cp_url;
}
}
// only add user if they do not already exist
$dbquery = "SELECT * FROM $cp_tablename
WHERE id = '" . $cp_id . "'";
$dbresult = mysql_query($dbquery);
if ($dbresult){
if ($row = mysql_fetch_assoc($dbresult)){
// if a row is found, then there's already this user in table, edit instead
CustomPageEdit($cp_tablename, $cp_id, $cp_url, $cp_selected_user, $cp_public);
return;
}
}
$dbquery = 'INSERT INTO '.$cp_tablename.' VALUES ('.$cp_id.', "'.$cp_url.'", '.$cp_public.', '.$cp_selected_user.');';
if (!mysql_query($dbquery)) {
die("Query Failed!  Custom Page NOT Inserted into database!<br />\n");
}
}

// function to edit a user's custom page in the table
function CustomPageEdit($cp_tablename, $cp_id, $cp_url, $cp_selected_user, $cp_public=0) {
// start our dbquery
$dbquery = "UPDATE $cp_tablename ";
// if no URL supplied, don't edit the URL
if ($cp_url != ''){
// add HTTP:// if necessary at front of link to prevent BASE URL applying in front of link provided
if (strtolower(substr($cp_url, 0, 7)) != "http://"){
$cp_url = "http://" . $cp_url;
}
// since an url was entered, add it to the update
$dbquery .= 'SET url = "'.$cp_url.'", public = '.$cp_public.', selected_user = '.$cp_selected_user.'
WHERE id = '.$cp_id.';';
} else {
// update all but the URL
$dbquery .= "SET public = $cp_public, selected_user = $cp_selected_user
WHERE id = $cp_id;";
}
if (!mysql_query($dbquery)) {
die("Query Failed!  Custom Page NOT Modified in database!<br />\n");
}
}

// function to delete Custom Page from the table
function CustomPageDel($cp_tablename, $cp_selected_user) {
// delete Custom Page with $cp_id
$dbquery = "DELETE FROM $cp_tablename WHERE id = $cp_selected_user;";
if (!mysql_query($dbquery)) {
die("Query Failed!  Custom Page NOT Deleted from database!<br />\n");
}
}


///////////  MAIN CODE HERE  ////////////
// Admins are always allowed to create a custom page
if ($context['user']['is_admin']){
$cp_admin = 1;
}

// convert $_POST vars to prevent undefined index errors
$cp_save = empty($_POST['cp_save']) ? '' : $_POST['cp_save'];
$cp_del = empty($_POST['cp_del']) ? '' : $_POST['cp_del'];
$cp_urlbox = empty($_POST['cp_urlbox']) ? '' : $_POST['cp_urlbox'];
$cp_public = empty($_POST['cp_public']) ? 0 : $_POST['cp_public'];
$cp_selected_user = empty($_POST['cp_selected_user']) || (!$cp_allow_public && !$cp_admin) ? $ID_MEMBER : $_POST['cp_selected_user'];

// get our script url including parameters (like ?page=6)
$myself = $_SERVER['REQUEST_URL'];

// put the SMF table prefix in front of your tablename from above
$cp_tablename = $db_prefix . $cp_tablename;
// do same for SMF Members table
$smf_members_table = $db_prefix . 'members';


////////////////   Security Checks  ////////////////
// check if user is in a group that is allowed to set a custom page
$cp_allowed = array_intersect($cp_allowed_groups, $user_info['groups']);

// don't let guests set page - would set default for all guests if they did
// also check if user is in the disallow array
if ($context['user']['is_guest'] || @in_array($ID_MEMBER, $cp_disallowed_members)){
$cp_allowed = false;
}

// Admins are always allowed to create a custom page
if ($cp_admin){
$cp_allowed = 1;
}
//////////////////////////////////////////////

// if someone just clicked Save, post info to database
if (!empty($cp_save) && $cp_allowed){
// if the urlbox had info in it, trim it
if (!empty($cp_urlbox)){
$cp_urlbox = trim($cp_urlbox);
} else {
$cp_urlbox = '';
}
CustomPageAdd($cp_tablename, $cp_id, $cp_urlbox, $cp_selected_user, $cp_public);
}

// if someone just deleted a page, remove it from database
if ($cp_del && $cp_admin){
CustomPageDel($cp_tablename, $cp_del);
}

////////////  MAIN DISPLAY CODE HERE  ///////////////
// set query to select all data for all users
$dbquery = "SELECT * FROM $cp_tablename;";
$dbresult = mysql_query($dbquery);

if ($dbresult){
// table exists - does it need an upate?
$row = mysql_fetch_assoc($dbresult);
if (in_array("public", array_keys($row))){
// no update needed here!
mysql_data_seek($dbresult, 0);
} else {
// YES!  then create the columns!
mysql_free_result($dbquery);
CustomPageModifyTable($cp_tablename);
// re-query the modified table
$dbresult = mysql_query($dbquery);
if (!$dbresult){
die("Unexpected error: " . mysql_error());
}
}
} else {
// no result, is it because table doesn't exist?
if (mysql_errno() == 1146){
// table doesn't exist, create it!
CustomPageCreateTable($cp_tablename);
// get our result again
$dbresult = mysql_query($dbquery);
if (!$dbresult) die("Unexpected error: " . mysql_error());
} else {
die("Unexpected error: " . mysql_error());
}
}

$cp_page = '';
$cp_selected_user = $ID_MEMBER;
$cp_selected_page = '';
// cycle through all rows
while ($row = mysql_fetch_assoc($dbresult)){
// add to public pages array if they have set to public (but not ourselves)
// or if the current user is an admin
if (($row["public"] != 0 || $cp_admin) && $row["id"] != $ID_MEMBER){
$cp_public_pages[$row["id"]] = $row["url"];
}
// if our row, get our public status, url, and our selected user
if ($row["id"] == $ID_MEMBER){
$cp_public = $row["public"];
$cp_page = $row["url"];
$cp_urlbox = $cp_page;
$cp_selected_user = $row["selected_user"];
}
}
$cp_public == 0 ? $cp_checked = '' : $cp_checked = "CHECKED";

// free previous result set
mysql_free_result($dbresult);
// if there were some public pages in table, setup the public users array
if (!empty($cp_public_pages)){
$dbquery = "SELECT ID_MEMBER, memberName FROM $smf_members_table
WHERE ID_MEMBER IN (" . implode(",", array_keys($cp_public_pages)) . ");";
$dbresult = mysql_query($dbquery);
if (!$dbresult) die("Unexpected error: " . mysql_error());
$cp_public_users = array();
while ($row = mysql_fetch_assoc($dbresult)){
$cp_public_users[$row["ID_MEMBER"]] = $row["memberName"];
}
// free the result for good measure
mysql_free_result($dbresult);
}

// get our selected user's page
if (!empty($cp_public_pages) && @in_array($cp_selected_user, @array_keys($cp_public_pages))){
$cp_selected_page = $cp_public_pages[$cp_selected_user];
}
// if the selected page is null "" then select our own page if it not ""
if (empty($cp_selected_page)){
if (!empty($cp_page)){
$cp_selected_page = $cp_page;
} else {
$cp_display_default ? $cp_selected_page = $cp_default_page : $cp_selected_page = '';
}
}

// display the $cp_selected_page to the user
if (!empty($cp_selected_page)){
echo '<center><IFRAME NAME="CustomPage" ALIGN=middle SRC="' . $cp_selected_page . '" WIDTH=' . $cp_width . ' HEIGHT=' . $cp_height . '>
' . $cp_no_iframe . '
</IFRAME></center>';
} else {
if ($cp_display_default){
echo '<center><IFRAME id="CustomPageID" NAME="CustomPage" ALIGN=middle SRC="' . $cp_default_page . '" WIDTH=' . $cp_width . ' HEIGHT=' . $cp_height . '>
' . $cp_no_iframe . '
</IFRAME></center>';
} else {
echo '<br />' . $cp_default_text . '<p />';
}
}

// only show form if user is allowed to add/edit their custom page
if ($cp_allowed){
//////////////////////////////////////////////////////////////////
/////////////           Javascript area              /////////////
//////////////////////////////////////////////////////////////////
// write out our javascript stuff

echo '
<script type="text/javascript">
<!--
// create our main array first
var jarray = new Array(); // list of member ids from pull down
var jarray2 = new Array(); // public page user ids
var jarray3 = new Array(); // public page urls
var jarray4 = new Array(); // array of public page user ids => public page urls
jarray[0] = '.$ID_MEMBER.';
jarray4['.$ID_MEMBER.'] = "'.$cp_page.'";
';
if (!empty($cp_public_pages)){
// create a list of public page user ids
$cp_public_user_list = implode(",", array_keys($cp_public_users));
$cp_page_ids = implode(",", array_keys($cp_public_pages));
foreach($cp_public_pages AS $key => $value){
if (empty($cp_page_urls)){
$cp_page_urls = '"' . $value . '"';
} else {
$cp_page_urls .= ',"' . $value . '"';
}
}
echo '
jarray.push('.$cp_public_user_list.');
// if our javascript is huge, big bandwidth waster, save some bandwidth here
jarray2.push('.$cp_page_ids.');
jarray3.push('.$cp_page_urls.');
y = jarray2.length;
for (x=0;x<y;x++){
page_id = jarray2[x];
jarray4[page_id] = jarray3[x];
}
';
}
echo '
function selectedChanged(){
s_id = jarray[document.cp_form.cp_selected_user.selectedIndex];
s_url = jarray4[s_id];
window.frames.CustomPage.location.href = s_url;
}
//-->
</script>
';


// start our form and table
echo '
<p /><form name="cp_form" action="' . $myself . '" method=post>
<table width="100%" border=0>
<tr>
<td width="40%">My Custom Page info:</td>
<td width="10%"></td>
<td width="40%">Public Member Pages</td>
<td width="10%"></td>
</tr>
<tr>
<td width="40%">URL: <input type=text name=cp_urlbox size="50" value="' . $cp_urlbox . '" /></td>
<td width="10%"></td>
<td width="40%" align="left">
<select name=cp_selected_user onChange="selectedChanged()">';
if ($cp_selected_user == $ID_MEMBER){
echo '
<option value="'.$ID_MEMBER.'" SELECTED>' . $user_info["username"] . '</option>
';
} else {
echo '
<option value="'.$ID_MEMBER.'">' . $user_info["username"] . '</option>
';
}
if (!empty($cp_public_users)){
foreach ($cp_public_users as $key => $value){
echo '

';
if ($cp_selected_user == $key){
echo '
<option value="'.$key.'" SELECTED>' . $value . '</option>
';
} else {
echo '
<option value="'.$key.'">' . $value . '</option>
';
}
}
}
echo '
</select>
</td>
<td width="10%"></td>
</tr>
<tr>
<td width="40%"><label><input type=checkbox name=cp_public value="1" ' . $cp_checked . ' />Make my page public</label></td>
<td width="10%"></td>
<td width="40%"></td>
<td width="10%"></td>
</tr>
<tr>
<td colspan="4" align="center"><input type=submit name=cp_save value="Save" /></td>
</tr>
</table>
</form>
';
}
Logged

Robot Moderatör
Anahtar Kelime
*****
Offline Pasif

Mesajlar: 42,063


View Profile
Re: Custom Page (tp bloc)
« Posted on: 05 Temmuz 2009, 23:06:51 »

 
      uyari
Merhaba ziyaretçi. Öncelikle sitemize hoşgeldiniz. Ben robot moderatör olrak siteden daha fazla yararlanmanız için sitemize üye olmanızı öneririm. iyi eğlenceler.

giris  kayit
Anahtar Kelimeler: Custom Page (tp bloc) oyunları, Custom Page (tp bloc) programı, Custom Page (tp bloc) oyunu indir, Custom Page (tp bloc) program yükle, Custom Page (tp bloc) download, Custom Page (tp bloc) hikayeleri, Custom Page (tp bloc) resimleri, Custom Page (tp bloc) haber, Custom Page (tp bloc) yükle, Custom Page (tp bloc) videosu, Custom Page (tp bloc)albüm indir,maçının golleri,seyret,dinle,izle,online izle bedava ödev indir msn eklentisi, şarkı sözleri,kurtlarvadisi,mp3,dizi,şarkı,indir,download, avatar, internet, Öss, Eğitim, Kpss, Üniversite, Lost, Dizi, Kurtlar Vadisi, Avrupa Yakası, Heroes, DVD, Program Download, Windows Xp, Vista, Donanım, Film, Sinema
Logged
Sayfa: [1]   Yukarı git
Yazdır
Sanalworld-Anahtar kelimelerCustom Page (tp bloc)Yeni albümler indir dinle,mp3 indir dinle,oyunlar dizi özetleri fragmanları,haber,yükle,filmi indir izle,online izle,bölüm online dizi izle,kurtlar vadisi pusu yeni bölüm fragmanı indir izle müzikleri,dizi müzikleri ,indir,download,adanalı dizisi,albümü indir,şarkıcı,yemek tarifleri,bedava ödev,ünlü resimleri,görüntüleri fotoğrafları,maçın golleri özetleri,Paylaşım, knight online, garip olaylar, galatasaray, Custom Page (tp bloc)fenerbahçe, beşiktaş, Film, Dizi, Müzik, Program, Oyun, Download, Dostluk, Sinema, Video, Eğlence, Komik, Mühendislik, Eğitim, Kadın, Siyaset, Resim, Cep, Bilgisayar, Kültür, Sanat, Tarih, Edebiyat, Turizm, Spor Custom Page (tp bloc)
Gitmek istediğiniz yer:  



TinyPortal v.1.0.6 beta 2 © Bloc
|Sitemap 1| 2| 3| 4| 5| 6| Wap| Wap 2| XML| Arşiv| Arşiv 2|index|Rss| Web Stats