Вопросы topic php forum

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Simple PHP Forum Application

License

dprabin/simple-php-forum-application

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Simple PHP Forum Application

This is a simple PHP Forum Application created with core PHP. It uses simple Model-View-Controller (MVC) like pattern. This PHP forum Application uses Object Oriented programming to create a forum. It uses PHP Data Object (PDO) to connect to database It supports

The controller are the files at root folder of the application. They are

  • index.php: The main controller
  • create.php: Controller to create a new forum topic
  • register.php: Controller to register a user
  • topic.php: Controller to display a forum topic and manage reply to it
  • topics.php: Controller to display multiple forum topics

Models are contained in libraries folder. Classes are defined for each model containing data and methods

  • Database.php: Class used to connect to database
  • Template.php: Calss to define and manage template or view
  • Topic.php: Class to define the forum topic
  • User.php: Class to define the user
  • Validator.php: Class to validate different input forms

The views are inside templates folder. Templates folder contains stylesheets, bootstrap javascripts and CKeditor files.

The core folder contains initializer code and the config folder contains configuration variables and constants. init.php reads config.php, connects to database and includes other required codes. This file is included in every controller.

The helpers folder contain helper functions that are needed by the code anywhere else. They are extensively used inside views. User avatar is stored in images/avatars and default avatar is stored in templates/img/.

To install this applicaion, create a db from talkingspace.sql file. then copy all other files to your htdocs folder and run.

Источник

Custom MySQL & PHP Forum — Список тем под категориями

Я работаю над пользовательским форумом по MySQL и PHP и пытаюсь разместить свои темы в соответствующих категориях. Когда я создаю тему в моей панели администратора, я могу установить идентификатор категории, который соответствует идентификатору категории. Я уже просмотрел немного в Интернете и на сайте здесь.

Я смог заставить категории отображаться и смог найти место, куда пойдут темы, но темы не отображаются, параметр, который я передаю, приводит к нулю и приводит к тому, что каждая категория показать, что темы не созданы

Это функция, над которой я работаю:

function fetch_forum() < global $connection; $query = "SELECT * FROM forum_categories LEFT JOIN forum_topics ON forum_topics.forum_topic_category_id = forum_categories.forum_category_id"; $select_forum_data = mysqli_query($connection, $query); $new_topic = ""; $pre_topic = ""; while($row = mysqli_fetch_assoc($select_forum_data)) < $forum_topic_id = $row['forum_topic_id']; $forum_topic_title = $row['forum_topic_title']; $forum_topic_description = $row['forum_topic_description']; $forum_topic_category_id = $row['forum_topic_category_id']; $forum_category_id = $row['forum_category_id']; $forum_category_title = $row['forum_category_title']; $new_topic = $forum_topic_title; if($forum_category_title != null) < echo ""; echo ""; echo " "; echo "Topics"; echo "Posts"; echo "Last Post"; echo ""; echo ""; > if($new_topic != $pre_topic) < echo ""; echo ""; echo "'> "; echo "1"; echo "1"; echo "03-28-2017"; echo ""; echo ""; > else < echo ""; echo ""; echo "No topics have been created"; echo ""; echo ""; > $pre_topic = $forum_topic_title; > > 

Это моя страница указателя:

Источник

ЧПУ для форума — нужно ли?

Добрый вечер! Имеет ли значение для индексации Яндексом вид страниц форума: /topic.php?forum=10&topic=11 или /topic10p11.htm На данный момент мой форум (immunoterapia.ru/forum) практически полностью вылетел их индекса Яндекса (осталось 20 страниц). Однако страницы сайта все в индексе. Есть ли смысл ставить ЧПУ? Повлияет ли это на индексацию?

Разницы нет, что первый вариант, что второй.

А вот вид чпу вроде: topic_nuzhno_li_cpu или в таком роде определённо даст эффект.

alexvod, ЧПУ на индексацию (точнее релевантность) повлияет, только приведенные вами ссылки — не ЧПУ.

Комплексное продвижение от группы профи. Внимательно, качественно, грамотно. Дизайн, контекст, таргет. (/ru/forum/1024059) hugo.digital (https://hugo.digital)

А есть ли разница между ссылками

Какой вариант будет лучше индексироваться Яндексом?

по моим наблюдениям разницы нет.

важен качественный контент.

делал по всякому у каждого из способов есть свои плюсы и свои минусы. вариантов, кстати, формирования урл, много, и не ограничивается тем что вы предложили.

я бы , на самом деле вообще сделал так

или так . орум.рф/кожный_дерматит.htm

если это делается для пользователя то ему ваши каталоги до одного места, он в урл в 99.99% менять их не будет.

вот единственное что для статистики хождения по каталогам.

повторюсь, на каждом своем новом проекте пробовал по разному и нет идеального способа 🙂

Хоть это и не совсем чпу, но поможет избавится от дублей страниц. Если еще и форум почистить возможно вернется в индекс.

Каким образом? Дубли — они по содержанию, а не по названию вычисляются. Дубли надо просто закрывать в роботсе, чпу на их наличие не повлияет.

alexvod:
Добрый вечер!

Имеет ли значение для индексации Яндексом вид страниц форума:
/topic.php?forum=10&topic=11
или
/topic10p11.htm

На данный момент мой форум (immunoterapia.ru/forum) практически полностью вылетел их индекса Яндекса (осталось 20 страниц). Однако страницы сайта все в индексе.

Есть ли смысл ставить ЧПУ? Повлияет ли это на индексацию?

Есть обоснованные подозрения, что сайты без cgi-параметров (или GET-параметров — то, что идет после ?), индексируются немного лучше, точнее алгоритмически пауки и выкладыватели в индекс реже ошибаются при всевозможных склейках страниц. К ЧПУ, это конечно же отношения не имеет, т.к. Вы привели для примера нечитаемые урлы.

Кстати, чтобы еще и правильнее на разделы Яндекс бил в приведенном Вами примере вообще лучше сделать адресацию типа /topic/10/11

Источник

PHP/MySQL Forum Comment Reply System Issues.

I designed a little PHP/MySQL forum (just for fun), and I have commenting set up and top threads on the homepage and whatnot. I’m relatively new to PHP, and this is the biggest project I’ve done, but the only problem is that I can’t think up a way to let people reply to an already-posted comment.

Anyway, I have a MySQL database called «forum», with three tables; «comment», «thread», and «user». I had the idea of creating a new field in the «comment» table called «reply-to_x » (each comment posted has a specific ID, and x being the comment that it replies to). But I have no idea how I would get PHP to know to place reply comments under the comments they reply to. Here is the code in showThread.php that looks through the database for comments:

  1. mysql_connect(‘localhost’,’root’,’fakepass’) or die(mysql_error());
  2. mysql_select_db(‘forum’) or die(mysql_error());
  3. $result = mysql_query(‘SELECT * FROM comment WHERE thread_id=’.$t);
  4. while($row = mysql_fetch_array( $result ))
  5. echo ‘
  6. echo ‘
  7. echo ‘

    ‘.$row[‘message’].’

    ‘.»\n»;

  8. echo ‘

‘.»\n»;

  • >
  • mysql_close(‘forum’);
  • ?>
  • Where $t is the showThread.php?t=x part of the address (t being the thread ID), $row[‘id’] is the unique comment ID (for that thread), $row[‘name’] is the author of the comment, and $row[‘message’] is the comment itself.

    Any ideas on how to make reply-tos possible?

    Источник

    Читайте также:  Python tkinter фрейм во фрейме
    Оцените статью