1

Topic: Favorite posts

##
##
##     Mod title:  PunBB Favorite posts
##
##     Mod version:  1.0
##     Works on PunBB:  1.1.5
##     Release date:  2004-10-13
##           Author:  zaher dirkey (zaher@parmaja.com)
##
##      Description:  add post to favorite post and show it as news
##
##   Affected files:  viewtopic.php
##
##       Affects DB:  Yes
##
##            Notes:  easy mod for front page (home page) of your site
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##

easy mod to mark a posts as favorties and show it as favorties or news in your front page (home page), you must integrate your home page with punbb forum

download here

http://www.punres.org/viewtopic.php?id=89

my front page site www.parmaja.com is demo for show favorites

If your people come crazy, you will not need to your mind any more.

2

Re: Favorite posts

I'll try and it doesn't work

I have uploaded all the files
I have changed viewtopic.php

but ...

I don't see which code to put in front page

I have put

<?
  include ('http://www.sortons.net/forum/favorites.php');
?>

Nothing happens ...

3

Re: Favorite posts

the code correct but you must add some code
read this

http://punbb.org/forums/viewtopic.php?id=4348

if you still have a problem, i will send you a sample about index.html

If your people come crazy, you will not need to your mind any more.

4

Re: Favorite posts

I still have a problem ... thanx about your patience smile

5 (edited by zaher 2004-10-16 22:44)

Re: Favorite posts

i release new file 1.0.1
download it you will find home.php as sample how to integrate your site with PunBB

demo www.parmaja.com/home.php

EDIT: relupload favorites.php,or all BTW

If your people come crazy, you will not need to your mind any more.

Re: Favorite posts

http://www.parmaja.com/forum/viewtopic.php?pid=3#3

Something wrong with your stylesheet?

7 (edited by zaher 2004-10-16 23:54)

Re: Favorite posts

tongue not stylesheet but it is forum for "Admins/moderators only"
i corrected by make it "Closed" only

thanks, you can test it again.

If your people come crazy, you will not need to your mind any more.

Re: Favorite posts

http://www.parmaja.com/forum/viewtopic.php?pid=5454665

Obviously a fake id, but there IS a problem

You have this there:

<link rel="stylesheet" type="text/css" href="/style/Parmaja.css">

Compared to this everwhere else:

<link rel="stylesheet" type="text/css" href="http://www.parmaja.com/forum/style/Parmaja.css">

9

Re: Favorite posts

Thanks a lot, i correcte it big_smile

If your people come crazy, you will not need to your mind any more.

10

Re: Favorite posts

I think I'm very dumb smile but where to download 1.0.1 ? On PunRes, there is only 1.0.0 ? smile

11

Re: Favorite posts

http://www.punres.org/files.php?pid=27
there is a samples\home.php for  how to use it

If your people come crazy, you will not need to your mind any more.

Re: Favorite posts

I don't know what is wrong here becouse it's always displaying this 
The file 'config.php' doesn't exist or is corrupt. Please run install.php to install PunBB first.
I have edited the viewtopic and added the php code above the header of my site...it's really weird becouse other stuff like showing you're logged as works but this thing not. Help is really appreciated.

if mONey is lOSt nOThINg is lOSt,
if cHArACtER is lOSt sOMeTHiNG is lOSt,
bUT,
if rELiGIon and eDUcATiON aRE lOSt eVErYThINg is lOSt.

13

Re: Favorite posts

FaRe-Ed:
favorites.php must be included from homepage, there is a sample "home.php" how to include it, is work good in my site (home) as news

but if you want to make acceess directly from browser i can modify it for you.

Rod : if you have a problem confim me?

If your people come crazy, you will not need to your mind any more.

Re: Favorite posts

yes i know how to use include, and i have looked your sample named index.php in the /sample folder.Are there something i miss because i've tried and using the file too but the same problem accured.

zaher wrote:

but if you want to make acceess directly from browser i can modify it for you.

i don't understand.You want to edit my file?

if mONey is lOSt nOThINg is lOSt,
if cHArACtER is lOSt sOMeTHiNG is lOSt,
bUT,
if rELiGIon and eDUcATiON aRE lOSt eVErYThINg is lOSt.

15 (edited by zaher 2004-10-27 22:39)

Re: Favorite posts

You want to edit my file

no i ment you cannot  type

http://www.domain.com/forum/favorites.php

it is reutrn that error
"The file 'config.php' doesn't exist or is corrupt. Please run install.php to install PunBB first"

but if you included in you home page and add some lines in start of page

<?php
  define('PUN_TURN_OFF_MAINT', 1);    // We don't want a maintenance message to appear on the front page
  define('PUN_QUIET_VISIT', 1);        // We don't want to update peoples cookies on the front page
  $pun_root = './forum/';    // The path to the forum root directory relative to this script
  include $pun_root.'include/common.php';

  // If PUN isn't defined, config.php is missing or corrupt
  if (!defined('PUN'))
      exit('config.php doesn\'t exist or is corrupt. Please run install.php to install PunBB first.');

must be work

If your people come crazy, you will not need to your mind any more.

Re: Favorite posts

Does the code above need to end with this tag ?>

if mONey is lOSt nOThINg is lOSt,
if cHArACtER is lOSt sOMeTHiNG is lOSt,
bUT,
if rELiGIon and eDUcATiON aRE lOSt eVErYThINg is lOSt.

17

Re: Favorite posts

no, must be in start of your index.php, the rest is index.php etc...

If your people come crazy, you will not need to your mind any more.

Re: Favorite posts

This is the home.php code

<?php
  define('PUN_TURN_OFF_MAINT', 1);    // We don't want a maintenance message to appear on the front page
  define('PUN_QUIET_VISIT', 1);        // We don't want to update peoples cookies on the front page
  $pun_root = './forums/';    // The path to the forum root directory relative to this script
  include $pun_root.'include/common.php';

  // If PUN isn't defined, config.php is missing or corrupt
  if (!defined('PUN'))
      exit('config.php doesn\'t exist or is corrupt. Please run install.php to install PunBB first.');

  // Now we determine what style we should use
  $style = (isset($cur_user)) ? $cur_user['style'] : $pun_config['o_default_style'];
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; <? echo 'charset='.$lang_common['lang_encoding'] ?>">
<meta name="abstract" content="">
<meta name="description" content="">
<meta name="keywords" content="">
<title>domain.com</title>
<link rel="shortcut icon" HREF="favicon.ico">
<link rel="stylesheet" type="text/css" href="http://fadered.hollosite.com/forums/style/<?php echo $style ?>.css">
</head>
  <body>
    <table dir="ltr" class="punplain" style="width: 100%; margin: auto" cellspacing="0" cellpadding="0">
      <tr>
        <td style="text-align: left; width: 120px">
          <div style="border-style: double; border-width: 3">
<?php if($cookie['is_guest'])
    echo 'Not logged in <br><a href="http://fadered.hollosite.com/forums/register.php">register?</a>
<a href="http://fadered.hollosite.com/forums/login.php">login?</a>';
else
    echo 'Logged in as: '.$cur_user['username'].'<br>Last visit: '.format_time($cur_user['last_visit']); ?></div></td>
        <td>
           
        </td>
      </tr>
    </table>

    <table class="punplain" style="width: 100%; margin: auto" cellspacing="0" cellpadding="0">
      <tr>
        <td class="puntop" width="120px">
          <table class="punmain" cellspacing="1" cellpadding="4">
            <tr class="punhead">
              <td class="punhead">
                Navigation
              </td>
            </tr>
            <tr>
              <td class="puncon2">
                <div class="item" style="width: 90%">
                  <b>· </b><a href="/"> Home </a><br>
                  <br>
                  <b>· </b><a href="/forums"> Forum </a><br>
                  <b>· </b><a href="/downloads"> Downloads </a><br>
                </div>
              </td>
            </tr>
          </table>

          <table class="punspacer" cellspacing="1" cellpadding="4"><tr><td> </td></tr></table>

          <table class="punmain" cellspacing="1" cellpadding="4">
            <tr class="punhead">
              <td class="punhead">
                Links
              </td>
            </tr>
            <tr>
              <td dir="ltr" class="puncon2">
                <div class="item" style="width: 65px">
                  <a href="http://punbb.org" target="_blank">punbb.org</a><br>
                  <a href="http://www.punres.org" target="_blank">punres.org</a><br>
                  <a href="http://www.sourceforge.net" target="_blank">sourceforge.net</a><br>
                </div>
              </td>
            </tr>
          </table>

          <table width="100%" cellspacing="1" cellpadding="4">
            <tr>
              <td align="center">
                <br>
                <b><a href="http://validator.w3.org/check/referer" target="_blank">Valid HTML 4.01</a></b>
                <br>
                <br>
                <b><a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank">Valid CSS</a></b>
                <br>
              </td>
            </tr>
          </table>
        </td>

        <td style="width: 20px"> </td>
        <td class="puntop">

          <table class="punplain" style="width: 100%; margin: auto" cellspacing="0" cellpadding="0">
            <tr>
              <td class="puntop">
                <?php
                  include('http://fadered.hollosite.com/forums/favorites.php');
                ?>
              </td>
              <td style="width: 10px"> </td>
              <td class="puntop" style="width: 180px">
                <!-- Recent discussions table-->
                <table class="punmain" cellspacing="1" cellpadding="4">
                  <tr class="punhead">
                    <td class="punhead">
                      Recent discussions
                    </td>
                  </tr>
                  <tr>
                    <td class="puncon2">
                      <div class="item">
                      <?php
                        include('http://fadered.hollosite.com/forums/active_topics.php');
                      ?>
                      </div>
                    </td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>
          <table class="punspacer" cellspacing="1" cellpadding="4"><tr><td> </td></tr></table>
        </td>
      </tr>
    </table>
  </body>
</html>

and the link result http://fadered.hollosite.com/home.php i don't know what is wrong becouse if my $pun_root = './forums/' dir is wrong the function that show you're logged in or not will not display.

if mONey is lOSt nOThINg is lOSt,
if cHArACtER is lOSt sOMeTHiNG is lOSt,
bUT,
if rELiGIon and eDUcATiON aRE lOSt eVErYThINg is lOSt.

19 (edited by zaher 2004-10-29 00:24)

Re: Favorite posts

Ah, you must include files like that

include('./forums/favorites.php');
or
include($pun_root.'favorites.php');

|
|
include('./forums/active_topics.php');
or
include($pun_root.'active_topics.php');

not that

Wrong...

include('http://fadered.hollosite.com/forums/favorites.php');

|
|

include('http://fadered.hollosite.com/forums/active_topics.php');
If your people come crazy, you will not need to your mind any more.

20 (edited by FaRe-Ed 2004-10-29 01:20)

Re: Favorite posts

Alhamdulillah, it's work now. Thanks for your help Zaher.

and one more question here.Now i have the favorite function that's mean only the post that selected will be showed right? The problem is how can i select a specific post to be displayed. As example i have 10 favourite post and i want 3 from it  to go to the main section and other 7 to  the other section.It will be great if you can make the function like that.Like in extern function example

<?php include('http://host.com/forums/extern.php?action=new&show=3&fid=9');
if mONey is lOSt nOThINg is lOSt,
if cHArACtER is lOSt sOMeTHiNG is lOSt,
bUT,
if rELiGIon and eDUcATiON aRE lOSt eVErYThINg is lOSt.

21

Re: Favorite posts

you must be an admin to browse a posts, iyou will find a link "Favorite" near of post bottom "Report | Delete | Edit | Quote | Favorite" click it, will make that post in favorites table etc...

OK i can make it  as internal and external include, in next version soon.

If your people come crazy, you will not need to your mind any more.

22 (edited by FaRe-Ed 2004-10-29 01:23)

Re: Favorite posts

zaher wrote:

OK i can make it  as internal and external include, in next version soon.

great!

if mONey is lOSt nOThINg is lOSt,
if cHArACtER is lOSt sOMeTHiNG is lOSt,
bUT,
if rELiGIon and eDUcATiON aRE lOSt eVErYThINg is lOSt.

23

Re: Favorite posts

I don't understand I keep getting a blank page!

Changed the code to:

define('PUN_TURN_OFF_MAINT', 1);
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
$pun_root = './';
require $pun_root.'include/common.php';

On the install_favorites.php, and I just get a blank page. My website is just the punnbb forum so no need for the ./forum addition in the code.

Need help thanks!