well its a work in progress smile sure they'll fix it
but question: how strongly is your css modified then?
if you could tell me what you've modified in yours from original maybe i can get it full height
thx.

1,552

(31 replies, posted in PunBB 1.3 discussion)

http://rapidshare.com/files/175113535/rating_script.rar   

here what I have untill now in manifest.xml , the rate.js   and screenshots aswell as the stars gifs...

any feedback on the xml please?

1,553

(31 replies, posted in PunBB 1.3 discussion)

I'm trying to find the hooks in functions.php
to place the  writeRate(identifier);    in the screenshots you can see below

Screenshot 1:
http://www.dumpt.com/img/files/pmu1agvhxstg0vk7ioa2_thumb.gif

see in proper size here

Screenshot 2:
http://www.dumpt.com/img/files/zeyx9wbpdvqyn0g91tgh_thumb.gif

see in proper size here

Any Input on that anyone? I'm not familiar with all these hooks so would be brilliant if a developer could say: hey you need to put it in XYZ for screenshot 2....

1,554

(31 replies, posted in PunBB 1.3 discussion)

PS: this is what comes after 5th rating star line   
        }
        echo '<br>';
    }
    else
    {
        echo '<p>Your Rating: ';
        echo ' <a href="include/rate.php?p='.$page.'&r=1&a=1"><img src="stars/empty.gif" border="0" name="'.$page.'one" onmouseover="Swap1(\''.$page.'\')" onmouseout="SwapBack(\''.$page.'\')" /></a><a href="include/rate.php?p='.$page.'&r=2&a=1"><img src="stars/empty.gif" border="0" name="'.$page.'two" onmouseover="Swap2(\''.$page.'\')" onmouseout="SwapBack(\''.$page.'\')" /></a><a href="include/rate.php?p='.$page.'&r=3&a=1"><img src="stars/empty.gif" border="0" name="'.$page.'three" onmouseover="Swap3(\''.$page.'\')" onmouseout="SwapBack(\''.$page.'\')" /></a><a href="include/rate.php?p='.$page.'&r=4&a=1"><img src="stars/empty.gif" border="0" name="'.$page.'four" onmouseover="Swap4(\''.$page.'\')" onmouseout="SwapBack(\''.$page.'\')" /></a><a href="include/rate.php?p='.$page.'&r=5&a=1"><img src="stars/empty.gif" border="0" name="'.$page.'five" onmouseover="Swap5(\''.$page.'\')" onmouseout="SwapBack(\''.$page.'\')" /></a>';
          echo '<br>';
    }
   
$result = mysql_query("SELECT `rating` FROM `".DB_TABLE."` WHERE `page` = '".$page."'");
        $num_rows = mysql_num_rows($result);
        $i=0;
        $star_value = 0;
        while($i<$num_rows)
        {
            $rating = mysql_result($result,$i);
            $star_value = $star_value + $rating;
            $i++;
        }
        if($star_value==0)
        {
            $avg_value = 0;
        }
        else
        {
            $avg_value = $star_value / $num_rows;
        }



//Assign Value
if ($avg_value <= 0  ){$rater_stars = "stars/00star.gif";}
if ($avg_value >= 0.5){$rater_stars = "stars/05star.gif";}
if ($avg_value >= 1  ){$rater_stars = "stars/1star.gif";}
if ($avg_value >= 1.5){$rater_stars = "stars/15star.gif";}
if ($avg_value >= 2  ){$rater_stars = "stars/2star.gif";}
if ($avg_value >= 2.5){$rater_stars = "stars/25star.gif";}
if ($avg_value >= 3  ){$rater_stars = "stars/3star.gif";}
if ($avg_value >= 3.5){$rater_stars = "stars/35star.gif";}
if ($avg_value >= 4  ){$rater_stars = "stars/4star.gif";}
if ($avg_value >= 4.5){$rater_stars = "stars/45star.gif";}
if ($avg_value >= 5  ){$rater_stars = "stars/5star.gif";}

    echo 'Avg Rating: <img src="'.$rater_stars.'" width="80" height="16" border="0" name="Rate"/>';
    echo '<br>';
    echo $num_rows." Ratings (Avg ".substr($avg_value,0,4).")";   
       

}
?>

1,555

(31 replies, posted in PunBB 1.3 discussion)

just to give you entire picture I need to do this:

I need to place

writeRate(identifier);

in either

item-subject

    of forum or in starting post of a forum post by a user/admin etc

imagine you have a list of topics and next to the item starter there is a rating of article

I'll be placing the this in manifest.xml

<hook id="hd_head">
      <![CDATA[
     $forum_head['ratings'] = '<script type="text/javascript" src="rate.js"></script>';
      ]]>
    </hook> 

to get the javascript.

for creating table I will use this 

$schema = array(
        'FIELDS'        => array(
            'id'            => array(
                'datatype'        => 'SERIAL',
                'allow_null'    => false
            ),
            'cat_name'        => array(
                'datatype'        => 'VARCHAR(80)',
                'allow_null'    => false,
                'default'        => '\'New Category\''
            ),
            'disp_position'    => array(
                'datatype'        => 'INT(10)',
                'allow_null'    => false,
                'default'        => '0'
            )
        ),
        'PRIMARY KEY'    => array('id')
    );
    $forum_db->create_table('categories', $schema);

from you smile
based on the following mysql statment

CREATE TABLE `tableName` (
          `ip` varchar(15) NOT NULL,
          `rating` varchar(1) NOT NULL,
          `page` varchar(99) NOT NULL,
          PRIMARY KEY  (`ip`,`page`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;




in original php I have this

<?
include("include/rate.php");
?>
above header

and this :
<?
writeRate(test);
?>
in body of rate.php

how should I implement this in the manifest.xml

the file include/rate.php looks like this:


$action = $_GET['a'];
if($action==1)
{
    rate();
}
if($action==2)
{
    reRate();
}

function rate()
{
    $star_value = $_GET['r'];
    $page       = $_GET['p'];
    $ip         = $_SERVER['REMOTE_ADDR'];
   
    //Add to database
    mysql_query("INSERT INTO `".DB_TABLE."` VALUES ('$ip','$star_value','$page')");
    $ref = $_SERVER['HTTP_REFERER'];
    header("Location: " .$ref);
}

function reRate()
{
    $star_value = $_GET['r'];
    $page       = $_GET['p'];
    $ip         = $_SERVER['REMOTE_ADDR'];
   
    //Add to database
    mysql_query("UPDATE `".DB_TABLE."` SET `rating` = '$star_value' WHERE `ip` = '$ip' AND `page` = '$page'");
    $ref = $_SERVER['HTTP_REFERER'];
    header("Location: " .$ref);
}

function writeRate($page)
{
    $ip = $_SERVER['REMOTE_ADDR'];
    $result = mysql_query("SELECT `ip` FROM `".DB_TABLE."` WHERE `ip` = '".$ip."' AND `page` = '$page'");
    $num_rows = mysql_num_rows($result);
    if($num_rows==1)
    {
        echo '<p>Your Rating: ';
        $result = mysql_query("SELECT `rating` FROM `".DB_TABLE."` WHERE `ip` = '".$ip."' AND `page` = '$page'");
        $rating = mysql_result($result, 0);
        if($rating == 1)
        {
            echo '<a href="include/rate.php?p='.$page.'&r=1&a=2"><img src="stars/starCurrent.gif" border="0" name="'.$page.'one" onmouseover="Swap1(\''.$page.'\')" onmouseout="SwapBackOne(\''.$page.'\')" /></a><a href="include/rate.php?p='.$page.'&r=2&a=2"><img src="stars/empty.gif" border="0" name="'.$page.'two" onmouseover="Swap2(\''.$page.'\')" onmouseout="SwapBackOne(\''.$page.'\')" /></a><a href="include/rate.php?p='.$page.'&r=3&a=2"><img src="stars/empty.gif" border="0" name="'.$page.'three" onmouseover="Swap3(\''.$page.'\')" onmouseout="SwapBackOne(\''.$page.'\')" /></a><a href="include/rate.php?p='.$page.'&r=4&a=2"><img src="stars/empty.gif" border="0" name="'.$page.'four" onmouseover="Swap4(\''.$page.'\')" onmouseout="SwapBackOne(\''.$page.'\')" /></a><a href="include/rate.php?p='.$page.'&r=5&a=2"><img src="stars/empty.gif" border="0" name="'.$page.'five" onmouseover="Swap5(\''.$page.'\')" onmouseout="SwapBackOne(\''.$page.'\')" /></a>';
        }
        if($rating == 2)
and so on for each rating of 5

basically i want to make this into an extension....

the original script has
rate.php
rate.js
/include/rate.php
(and includes/constants.php where db info was placed)
/stars/  (gifs)

its working now in IE7, but placing of the postentry is stil lthe same as in my previous sceenshot post. i.e its too far down. i see the smilies in original size now though big_smile way cool  smile

also
its not visible in FF and Chrome due to this issue maybe that fluxbb has aswell=?
http://fluxbb.org/forums/topic/2369/tex … port-form/

fair enough smile good work anyway. thanks again.

PS: i dont thinks its browser issue... but of height .... of quick reply... but maybe a developer can look at it hopefully and tell us if somethings bug y  in 1.3.2 ....

http://rapidshare.com/files/174847985/screenshotie7.gif

the box is screwing it up my end
couldnt see it in firefox or chrome at all
this screenshot is a IE7 one

and when i hover over images it doesnt show them in that box.

can you maybe tell me again which line exactely you put it in ?

Just followed those instructions on a test forum I have and got the following screenshots...
My test forum is on 1.3.2
maybe you could install a test forum standard installation and then implement this "extension" (lot of code changing big_smile ) - if it works; add the changed files to the zip or rar whatever.

what is working great is that it gets the :myname: i ve added to folder img and it even adds it to help - def love that (that part of code should be standard in next release I think)

here what i get after following your steps:

http://www.dumpt.com/img/files/59dq3me0ig6zxd3dhdsx_thumb.gif

see Firefox screenshot here

http://www.dumpt.com/img/files/9jgvha7w14p4e36hpg2j_thumb.gif

see google chrome screenshot here

fine by me. not doing it for credit or monetary sake smile and yours is better in that it chooses all images from folder ; that was annoying me with mine... could i use your code that says gett all from folder if I change created by to include your name?

definitely very good.
animated gifs also work?
example?
thx

1,562

(31 replies, posted in PunBB 1.3 discussion)

thanks; 
will i need to include this which is now named  include/constants.php somehow in manifest.xml

<?
define("DB_SERVER", "");
define("DB_USER", "");
define("DB_PASS", "");
define("DB_NAME", "");
define("DB_TABLE", "");

$dbhandle = mysql_connect(DB_SERVER,DB_USER,DB_PASS) or die(mysql_error());
mysql_select_db(DB_NAME, $dbhandle) or die(mysql_error());
?>

or is this information that can be called upon differently with a hook or something

1,563

(31 replies, posted in PunBB 1.3 discussion)

These are the three files that this rating extension has
(plus there is a folder "/stars/" with the images)
include/rate.php
rate.js
manifest.xml
(links lead to my forum - just so that not all the code is cluttering this post!)

I would appreciate anyone (dev, etc) taking a hard look at it -  as I can't get it to work yet.

Main trouble being:

1. uninstall section in manifest.xml  aswell as unsure about install manifest.xml

2. hooks are working for placing in header but only show "ratings" text, instead of showing the gif of stars rating

any feedback welcome
PS: if anyone can make this work for $ - just give me a price and satisfaction guarantee big_smile




working on a rating extension of posts/page and i need to integrate this ;
SQL statement

             CREATE TABLE `tableName` (
          `ip` varchar(15) NOT NULL,
          `rating` varchar(1) NOT NULL,
          `page` varchar(99) NOT NULL,
          PRIMARY KEY  (`ip`,`page`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

any pointers please?

EDIT: Changed Title.

Thx much appreciated!

the url links in posts I meant sorry ....
so in a users post: www.xyz.com   <-- i want that to open in a tab

so target open in a new tab or window if tab isnt possible....  (_blank)

....

I'd prefer for my site to change the default to
open in new tab
not always in own

where can I set that?
is there a hook or something i can call on?

thanks for any input

ADDED 01-01-2009   Custom_Smilies  2.1
Download the Custom Smilies Extension 2.1
This set will now work with pun_bbcode   ( and  also without  bbcode running)

showing  20x20 without any manual modification of any other files. It will also show help correctly.
I tested it on trunk r1002
(important that you have latest include/parser.php£)

give me feedback on smilies you'd like added or alternative sets!


________________________________________________________________

ADDED 29-12-2008:
Download the Custom Smilies Extension 2.0

This release will make all the smilies in the post appear at 20x20 instead of 15x15.
[you can easily change your preference in the manifest.xml by modifying those values...]
Make sure you have the latest include/parser.php installed (I've attached it in .rar in case)

If you're using PUN_BBCODE you can change size , by replacing this in pun_bbcode/bar.php

<?php

// Display the smiley set
foreach (array_unique($smilies) as $smile_text => $smile_file)
    echo '<a href="javascript:insert_text(\''.$smile_text.'\', \'\');" tabindex="'.($tabindex--).'"><img src="'.$base_url.'/img/smilies/'.$smile_file.'" width="20" height="20" alt="'.$smile_text.'" /></a>'."\n";

?>    

and if you want help.php to show them in 20x20

<?php

    // Display the smiley set
    if (!defined('FORUM_PARSER_LOADED'))
        require FORUM_ROOT.'include/parser.php';

    $smiley_groups = array();

    foreach ($smilies as $smiley_text => $smiley_img)
        $smiley_groups[$smiley_img][] = $smiley_text;

    foreach ($smiley_groups as $smiley_img => $smiley_texts)
        echo "\t\t\t\t".'<p>'.implode(' '.$lang_common['and'].' ', $smiley_texts).' <span>'.$lang_help['produces'].'</span> <img src="'.$base_url.'/img/smilies/'.$smiley_img.'" width="20" height="20" alt="'.$smiley_texts[0].'" /></p>'."\n";

?>

----------------------------------------------------------------------------------------------------
OLD:
Be my guineapig;

Download the Custom Smilies Extension Beta

Question: How do you think I should handle rows where smilies take up 3/4 of width (at the moment it right aligns them;
a. should I left align it aswell under B I U etc   or
b. work on a Tab that only shows them if you hover over it ( smile will need help with that)

What It Does:
replaces all smilies with this set
Screenshot:
http://www.dumpt.com/img/files/rowziqvbqbarvawjusgu_thumb.gif

see in proper size here

'smile.png', '=)' => 'smile.png', ':|' => 'neutral.png', '=|' => 'neutral.png', ':(' => 'sad.png', '=(' => 'sad.png', ':D' => 'laughing.png', ';)' => 'wink.png', ':/' => 'blink.png', ':P' => 'tongue.png', ':p' => 'tongue.png', ':cool:' => 'cool.png', ':whistling:' => 'whistling.png', ':wassat:' => 'wassat.png', ':unsure:' => 'unsure.png', ':tongue:' => 'tongue.png', ':sick:' => 'sick.png', ':silly:' => 'silly.png', ':sideways:' => 'sideways.png', ':pinch:' => 'pinch.png', ':kissing:' => 'kissing.png', ':angry:' => 'angry.png', ':blush:' => 'blush.png', ':cheerful:' => 'cheerful.png', ':devil:' => 'devil.png', ':dizzy:' => 'dizzy.png', ':ermm:' => 'ermm.png', ':icon_exclaim:' => 'icon_exclaim.gif', ':icon_arrow:' => 'icon_arrow.gif', ':icon_idea:' => 'icon_idea.gif'

Designed for:
1.3.2
changes:
fixed smilie.png to sick.png as was missing.

<hooks>
            <hook id="ps_start"><![CDATA[
       
        //this adds the custom set of smilies
   
            foreach($smilies as $k=>$v) $smilies[$k] = '../../extensions/custom_smilies/img/'.$v;
           
        ]]></hook>
           
    </hooks> 

works!

thanks !

thanks a lot , will try !

<hook id="ps_start"><![CDATA[
       
        //this adds the custom set of smilies
       
            $smilies = array(':)' => $ext_info['url']/extensions_name/img/smilie.png,  ':|' => $ext_info['url']/extensions_name/img/neutral.png);

        ]]></hook>

would that work?
or how do I make the  smiley path in the array relative to the forum root

//
// Convert a series of smilies to images
//
function do_smilies($text)

on line 758 in parser.php ?

Be my guineapig;

Download the Custom Smilies Extension Beta

Question: How do you think I should handle rows where smilies take up 3/4 of width (at the moment it right aligns them;
a. should I left align it aswell under B I U etc   or
b. work on a Tab that only shows them if you hover over it ( smile will need help with that)





edited above
original post below


******************************************************************

I'm working on an extension which overrides the default smilies with a completely new set;

based on include/parser.php line 19
($hook = get_hook('ps_start')) ? eval($hook) : null;


What needs changing here [in addition to location (in colors)] being changed?

        <hook id="ps_start"><![CDATA[
       
        //this adds the custom set of smilies
       
            $smilies = array(':)' => 'smile.png', '=)' => 'smile.png', ':|' => 'neutral.png');
           
            <img src="'.$ext_info['path'].'/img/smile.png"/>
   
        ]]></hook>

How do I include the img src location in green above so that normal location red doesn't show?

Thanks for any pointers

Well I recently downloaded most recent 1.3.2 and adminstrator area stays english.
Let me know if you ever know of someone who has it working in 1.3.2.

I've tried both. All works except admin.

@Slavok
Can you give me a bit more information on how to use that method? Assuming I want to change the code of your official pun_pm so that my code (extension) gets it properly

array_insert($links, 'pm', '<li id="navextra"><a href="pm_link">pm_link</a></li>');
where would above ^^ code go (file, line) , what would it replace

if (isset($links['pm']))
and where that one ^^  (file, line)

sorry if these are novice questions...

additional info; the administrator section stays english with the download from your site in 1.3.2
http://lab42.movedesign.de/?dl=5
i guess thats fine
i also tested it in fluxbb where it works except clicking the search link returns this error
Notice: Undefined index: Search info in     search.php on line 401

thanks again for the great effort.