Премини към съдържанието
Форумът в приложение

По-лесно сърфиране. Научи повече.

Kaldata.com - Форуми

Приложение на форума на цял екран с push известия, значки и други.

За да инсталирате това приложение на iOS и iPadOS
  1. Докоснете Иконата за споделяне в Safari
  2. Превъртете менюто и докоснете Добавяне към началния екран.
  3. Докоснете Добавяне в горния десен ъгъл.
За да инсталирате това приложение на Android
  1. Докоснете менюто с 3 точки (⋮) в горния десен ъгъл на браузъра.
  2. Докоснете Добавяне към началния екран или Инсталиране на приложение.
  3. Потвърдете, като докоснете Инсталиране.

Добре дошли!

Добре дошли в нашите форуми, пълни с полезна информация. Имате проблем с компютъра или телефона си? Публикувайте нова тема и ще намерите решение на всичките си проблеми. Общувайте свободно и открийте безброй нови приятели.

Моля, регистрирайте се за да публикувате тема и да получите пълен достъп до всички функции.

 

Интегриране

Featured Replies

Как мога да интегрирам IPB login,IPB последни теми и rss от IPB форум в обикновен PHP сайт (не система)!

  • 1 месец по-късно...
Как мога да интегрирам IPB login,IPB последни теми и rss от IPB форум в обикновен PHP сайт (не система)!

Интеграция

Интеграция на IPB със сайт. Автор: human


<?php

$host="localhost";//хоста

$db_user="root";//дб потребител

$db_password=""; //дб парола

$database="mysql"; //дб име

mysql_connect($host,$db_user,$db_password);

mysql_select_db($database);//свързваме се към бд

$pyt="forum/"; //пътя до форума

if (isset($_COOKIE["member_id"])) { //проверява дали има бисквитки

if ($_COOKIE["member_id"] == 0) { //ако не е логнат даваме формата за вход


echo "<table><form action='".$pyt."index.php?act=Login&CODE=01' method='post' name='LOGIN'>

<tr><td>Потребител:</td><td> <input type='text' size='25' maxlength='64' name='UserName'></td></tr>

<tr><td>Парола</td><td> <input type='password' size='25' name='PassWord'></td></tr>

<tr><td>Запомни ме? <input class='checkbox' type='checkbox' name='CookieDate' value='1' checked='checked'></td></tr>

<tr><td>Анонимно <input class='checkbox' type='checkbox' name='Privacy' value='1'></td></tr>

<tr><td><input class='button' type='submit' name='submit' value='Влез'></td></tr>

</form>

<tr><td><a href='".$pyt."index.php?act=Reg'>Регистрация</a></td><td><a href='".$pyt."index.php?act=Reg&CODE=10'>Забравена парола</а></td></tr>";

}

else { //, но ако е логнат показваме инфо

$query = mysql_query("SELECT name FROM ibf_members where id='$_COOKIE[member_id]'") or die(mysql_error());

while($r = mysql_fetch_array($query)) //взимаме потребителя от БД

{

echo"<a href='".$pyt."index.php?showuser=".$_COOKIE[member_id]."'>$r[name]</a><br>

<a href='".$pyt."index.php?act=UserCP&CODE=00'>Контрол панел</a>";

}

}

}

else {//ако няма бисквитки показваме формата за вход


echo "<table><form action='".$pyt."index.php?act=Login&CODE=01' method='post' name='LOGIN'>

<tr><td>Потребител:</td><td> <input type='text' size='25' maxlength='64' name='UserName'></td></tr>

<tr><td>Парола</td><td> <input type='password' size='25' name='PassWord'></td></tr>

<tr><td>Запомни ме? <input class='checkbox' type='checkbox' name='CookieDate' value='1' checked='checked'></td></tr>

<tr><td>Анонимно <input class='checkbox' type='checkbox' name='Privacy' value='1'></td></tr>

<tr><td><input class='button' type='submit' name='submit' value='Влез'></td></tr>

</form>

<tr><td><a href='".$pyt."index.php?act=Reg'>Регистрация</a></td><td><a href='".$pyt."index.php?act=Reg&CODE=10'>Забравена парола</а></td></tr>";

}

?>
Последни теми от форума. Но трябва да е в папката на форума
<?

/////////////////////////////

// User Editable variables //

/////////////////////////////


// по колко поста да показва в случея са 10

$posts = 10;


// If you would like this mod to cut topics after a certain character length, leave this at 1. Otherwise, change it to 0.

$showtopiclength = 1;


// Only useful if the above varaible is set to 1.

$topiclength = 40;


// Add forumid's to exclude from. For example, you might want to exclude your private forums so that posts from it

// do not show up. Seperate each forumid by a comma and ensure there's no spaces in between.

$forumexclude = "38,37,71,73,69,44,75,108,74";


/*

времето което ще показва


0 = only days

1 = only hours

2 = only minutes

3 = only seconds *** NOT WORKING ***

4 = hours and minutes

5 = hours and seconds

6 = minutes and seconds

7 = hours, minutes, seconds


Please select which interval to use (besides option 3, which is not working correctly):

*/


$interval = 6;


/*

This will display the time interval between posts

Example: posted 3 minutes ago

Example: posted 2 hours and 3 minutes ago

Example: 1 day, 5 hours ago

*/


//OR display date only

// The following 2 lines can be changed to however you want the date and time to be displayed.

// Default date: dd month year

// Default time: hh:mm ampm TIMEZONE (12 hour time)

// For more information on how the next 2 lines can be changed, please reference the README file.

// If you elect to show the date and time it was posted instead of the way shown above ONLY, change the $showtime variable to 1.

$showtime = 0;

$datedisplay = 'd F Y';

$timedisplay = 'h:i A T';


//////////////

// Required //

//////////////


require "conf_global.php";


//////////////

// Свързване с базата данни//

//////////////


$mysql = mysql_connect( $INFO['sql_host'], $INFO['sql_user'], $INFO['sql_pass'] /*, $INFO['sql_driver'] */ );

if ( !$mysql ) {

die( "<b>mysql_connect()</b>: ". mysql_error() );

}


$select_db = mysql_select_db( $INFO['sql_database'], $mysql );

if ( !$select_db ) {

die( "<b>mysql_select_db()</b>: ". mysql_error() );

}



// Query the DB with the supplied user inputted variables.

if ($forumexclude <> "") {

$getposts = mysql_query("SELECT posts, last_poster_name, last_poster_id, title, tid, forum_id, last_post FROM ibf_topics WHERE (forum_id NOT IN ($forumexclude)) ORDER BY last_post DESC LIMIT $posts") OR DIE (mysql_error());

}

else {

$getposts = mysql_query("SELECT posts, last_poster_name, last_poster_id, title, tid, forum_id, last_post FROM ibf_topics ORDER BY last_post DESC LIMIT $posts") OR DIE (mysql_error());

}


// Format and display the results.

while ( $post = mysql_fetch_array($getposts)) {


$post[full_title] = $post[title];

if ($showtopiclength == 1 AND strlen($post[full_title]) > $topiclength) {

$post[short_title] = substr($post[full_title],0,$topiclength);

$post[short_title] = $post[short_title]."...";

}

else {

$post[short_title] = $post[full_title];

}


$posted_on = date($datedisplay, $post[last_post]); // Need to change mySQL timestamp to something more human readable.

$today_date = date($datedisplay, time()); // Grab today's date so we can compare it against the posted date


if ($showtime == 0) {

$showtimediff = timediff($interval,time(),$post[last_post]);

$datefield = $showtimediff;

}

else {


// If it was posted today, we want to display "Today, hh:mm AMPM"

If ($posted_on == $today_date) {

$datefield = "Today";

$datefield = $datefield . ", " . date($timedisplay, $post[last_post]);

}


// If it was posted yesterday, we want to display "Yesterday, hh:mm AMPM"

elseif (date('d F Y',strtotime("-1 day")) == $posted_on) {

$datefield = "Yesterday";

$datefield = $datefield . ", " . date($timedisplay, $post[last_post]);

}


else {

$datefield = $posted_on;

}

}


echo

/////////////////

// Post Format //

/////////////////

// Between the EOD markers you can put whatever you want in HTML format. Just ensure that the link stays somewhat the same.

<<<EOD


<a href="$INFO[board_url]/index.php?showtopic=$post[tid]&view=getnewpost">$post[short_title]</a> by

<a href="$INFO[board_url]/index.php?showuser=$post[last_poster_id]">$post[last_poster_name]</a> <BR>

$datefield, with $post[posts] replies.<P>


EOD;

}


function timediff($interval, $starttime, $endtime) {


$timediff = $starttime - $endtime;

$days=intval($timediff/86400);

$remain=$timediff%86400;

$hours=intval($remain/3600);

$remain=$remain%3600;

$mins=intval($remain/60);

$secs=$remain%60;


$pluraldays = ($days < 2) ? " day " : " days ";

$pluralhours = ($hours < 2) ? " hour " : " hours ";

$pluralmins = ($mins < 2) ? " minute " : " minutes ";

$pluralsecs = ($secs < 2) ? " second " : " seconds ";

$hourcount = ($hours == 0) ? 1 : 0;

$minscount = ($mins == 0) ? 1 : 0;

$secscount = ($secs == 0) ? 1 : 0;


if ($days > 1) {

// If a post is older than Yesterday we want to display the the date and time it was created rather than how long ago.

// This makes it easier to display rather than having it say 3 days, 5 hours ago, for example.

$timediff = $posted_on;

}

elseif ($days == 1) {

// The post is within 1 day old. In this case, I've decided it may be best to show only 1 day, 5 hours ago, for example.

$timediff = "posted ".$days." day and ".$hours.$pluralhours." ago";

}

else {

// Less than 1 day has passed and here we use the interval that was set above.

if ($interval == 0) { $timediff = "posted ".$days.$pluraldays." ago";} // show only days

elseif ($interval == 1) { $timediff = "posted ".$hours.$pluralhours." ago";} // show only hours

elseif ($interval == 2) { $timediff = "posted ".$mins.$pluralmins." ago";} // show only minutes

elseif ($interval == 3) { $timediff = "posted ".$secs.$pluralsecs." ago";} // show only seconds


elseif ($interval == 4) { // show hours and minutes

if ($hourcount) { $timediff = "posted ".$mins." ".$pluralmins." ago"; }

else if ($minscount) { $timediff = "posted ".$hours." ".$pluralhours." ago"; }

else { $timediff = "posted ".$hours.$pluralhours." and ".$mins." ".$pluralmins." ago"; }

}

elseif ($interval == 5) { // show hours and seconds

if ($hourscount) { $timediff = "posted ".$secs." ".$pluralsecs." ago"; }

else if ($secscount) { $timediff = "posted ".$hours." ".$pluralhours." ago"; }

else { $timediff = "posted ".$hours.$pluralhours." and ".$sec." ".$pluralsecs." ago"; }

}

elseif ($interval == 6) { // show minutes and seconds

if ($minscount == 1) { $timediff = "posted ".$secs." ".$pluralsecs." ago"; }

else if ($secscount == 1 ) { $timediff = "posted ".$mins." ".$pluralmins." ago"; }

else { $timediff = "posted ".$mins.$pluralmins." and ".$secs." ".$pluralsecs." ago"; }

}

else { // show hours, minutes and seconds

$timediff = "posted ".$hours.$pluralhours.", ".$mins." ".$pluralmins." and".$secs." ".$pluralsecs." ago";

}

}


return $timediff;


}

?>

Редактирано от Munez (преглед на промените)

Добавете отговор

Можете да публикувате отговор сега и да се регистрирате по-късно. Ако имате регистрация, влезте в профила си за да публикувате от него.

Гост
Публикацията ви съдържа термини, които не допускаме! Моля, редактирайте съдържанието си и премахнете подчертаните думи по-долу. Ако замените букви от думата със звездички или друго, за да заобиколите това предупреждение, профилът ви ще бъде блокиран и наказан!
Напишете отговор в тази тема...

Разглеждащи това в момента 0

  • Няма регистрирани потребители разглеждащи тази страница.

Дарение

  • Подкрепи съществуването на форума - направи дарение
    25%
    Дарени 252.69 EUR от нужните 1,000.00 EUR

Бюлетин

Получавайте известие, когато има важна промяна или новина свързана с форума.

Профил

Навигация

Търсене

Търсене

Конфигуриране на push известия в браузъра

Chrome (Android)
  1. Докоснете иконата на катинар до адресната лента.
  2. Докоснете Разрешения → Известия.
  3. Променете предпочитанията си.
Chrome (Desktop)
  1. Кликнете върху иконата на катинар в адресната лента.
  2. Изберете Настройки на сайта.
  3. Намерете Известия и коригирайте предпочитанията си.