1 jimmy Sep 13, 2004 05:16
3 jimmy Sep 13, 2004 17:39
hi, ladybird,
create table into "mysql" Database have many ways...
u must know how to connect mysql, select DB u want, and create table
i think u can read first before u want hack something in b2evo
3.1 Connecting to and Disconnecting from the Server
3.3.1 Creating and Selecting a Database
3.3.2 Creating a Table
on this link
http://dev.mysql.com/doc/mysql/en/Tutorial.html
than connect mysql, chose a DB b2evolution build in,
and type the code in step 1 i wrote
4 medya Feb 09, 2005 23:36
I need your Help Jimmy...
I love Taiwan , Because I feel your pain !
I am a kurd and my country is invaded by 6 country so there is no Kurdistan...now ...
whenever I see Taiwan's indepence I feel good, and I feel bad when I see China's warning.
I have a Kurdish Blog --> Rojbash.net , we are a group that post intresting links , everyday ,
I want to add something so peopel can Rate each link , and i can have the best links of the Week in a page or at side bar,
mind that peopel here don't click on the Permanent link or Read more link , peopel here click on the Tilte that contains a link to go .
do you have any idea or help ?
I would love your help !
5 jimmy Feb 10, 2005 05:33
Vote system?
or Hit rating recorder?
If you need Hit rating recorder you can see Edb's hack below:
http://wonderwinds.com/hackblog.php/2005/01/15/a_better_heavy_hitters
6 medya Feb 10, 2005 07:51
I want something like this :
Peopel can Rate a posts with (1-5) numbers. and we can have the high rated posts on the side bar.
or
as long as that my blog is a Linking To Good News Blog , it would be good to count the most clicked links and have them on the side bar .
(in our blog, we put links in the LINK FIELD)
my blog adress : www.rojbash.net
7 jimmy Feb 10, 2005 09:58
medya wrote:
Peopel can Rate a posts with (1-5) numbers.
you can use this:
http://forums.b2evolution.net/viewtopic.php?t=1668&highlight=vote
and we can have the high rated posts on the side bar.
and get some code of EDB's Heavy Hitter.
http://wonderwinds.com/hackblog.php/2005/01/15/a_better_heavy_hitters
8 nims Jul 26, 2005 02:50
Hey jimmy, this is a great hack! I used it, and what I realy like about it, is that the performance is very good of this one.
I was wondering if you know any way to show a little overview of the most hitted items.
The SQL query should be something like this:
SELECT *
FROM `post_rate`
ORDER BY post_rating DESC
LIMIT 0 , 20
But I don't know realy how to transform this to a little list of topics that is shown e.g. in the sidebar. Can someone or you explain how to do this?
9 ferrethouse2005 Oct 29, 2005 07:39
I don't have a file conf/hacks.php :-/
Edit: I suspect this was introduced in .11. I only have .10
I'm guessing hacks.php is simply a file that is included on all the relevent pages so that any functions dropped into that file will work. Can I simply drop this code into one of the other included pages (that exist in .10) and this mod should work. I'd love to get this mod going but simply don't have the time to upgrade my blog to the latest version at this time.
Thanks.
10 yabba Oct 29, 2005 08:09
hacks.php doesn't exist you have to create it.
Open notepad, copy and paste the relevant code and save it as hacks.php and upload it to your conf folder.
¥
11 ferrethouse2005 Nov 12, 2005 00:50
Fatal error: Call to a member function on a non-object in /home/mydir/public_html/blog/skins/custom/_main.php on line 53
I created the table. I uploaded hack.php but I get this error on both function calls.
I'm using the latest b2evolution version. Anyone?
Thanks!
12 jimmy Nov 12, 2005 04:27
ferrethouse2005 wrote:
I created the table. I uploaded hack.php but I get this error on both function calls.
hacks.php not hack.php
maybe you can check that
answer is below.
13 jimmy Nov 15, 2005 08:00
ferrethouse2005 wrote:
Fatal error: Call to a member function on a non-object in /home/mydir/public_html/blog/skins/custom/_main.php on line 53
Maybe your code at wrong position.
add this code into while loop at /skins/ur_skin/_main.php
after this line
if( isset($MainList) ) while( $Item = $MainList->get_item() ) {
insert this code
<?php if( $disp == 'single' ) save_rate( $Item->get('ID') ); ?>
14 ph Nov 20, 2005 13:27
p.s set "true" to show img, default set is false to show text
u need add 0.gif~10.gif into IMAGEROOT defined in conf/hacks.php
any ideas where to get this sort of images to use with your hack?
thanks
15 jimmy Nov 20, 2005 17:10
ph,
google image can find many many...
http://images.google.com/images?q=rating&svnum=10&hl=en&lr=&sa=G&imgsz=icon
or you can draw something yourself.
16 ph Nov 21, 2005 08:33
jimmy wrote:
ph,
google image can find many many...
http://images.google.com/images?q=rating&svnum=10&hl=en&lr=&sa=G&imgsz=iconor you can draw something yourself.
i thought about google, but my search results did not hit the target. thanks for your reply.
17 pablo Jan 04, 2006 07:23
is there any way to show a list of most popular hitting post??
thanks for the answer
18 pyogazel Jun 19, 2006 08:27
Thank you very much, this hack is great and easy to apply, I'm really pleased with the result!
I modified it as you said to count max/200 instead of max/10, I just added more pictures,
as for the ALT feature, I'm thinking of writing
$alt = "alt=\"Read $Rating times\"";
(did it in French) instead of
$alt = "alt=\"Hit Rating!\"";
it works.
Thank you so much again!
19 pyogazel Jun 19, 2006 08:32
Pablo wrote:
is there any way to show a list of most popular hitting post??
thanks for the answer
There should be a way, imitating this very hack : create a table, create a IF that checks the $rating status for every post and then ECHO that table somewhere in your page.
But I'm not php-fluent enough to write this down, sorry :oops:
20 nims Aug 30, 2006 00:54
See this in action at http://www.goedzo.com
Here is the implementation of the list of most hitted topics:
Add the following code to hacks.php:
function read_most_rated() {
global $DB;
$query = "SELECT pr.post_id, pr.post_rating, ep.post_title, ep.post_urltitle FROM `post_rate` AS pr LEFT JOIN evo_posts AS ep ON pr.post_id = ep.id where post_title != \"\" ORDER BY post_rating DESC LIMIT 0 , 20";
$ratings = $DB->get_results( $query, ARRAY_N );
return $ratings; //is an array
}
function read_least_rated() {
global $DB;
$query = "SELECT pr.post_id, pr.post_rating, ep.post_title, ep.post_urltitle FROM `post_rate` AS pr LEFT JOIN evo_posts AS ep ON pr.post_id = ep.id where post_title != \"\" ORDER BY post_rating ASC LIMIT 0 , 20";
$ratings = $DB->get_results( $query, ARRAY_N );
return $ratings; //is an array
}
In your skin file add this (I used my sidebar).
<div class="bSideItem">
<h3 class="sideItemTitle">Most viewed topics</h3>
<?php
$ratings = read_most_rated();
foreach( $ratings as $r){
$NewItem = Item_get_by_ID( $r[0] );
$permalink = $NewItem->gen_permalink( '', '', false, '&' );
$title = $r[2];
if (strlen($title) > 30) {
$title = substr($title,0,30)."...";
}
else {}
echo "<a href=\"".$permalink."\">".$title."</a> (".$r[1].")<br />\r\n";
}
?>
</div>
And for the least viewed topic (alway fun to show)
<div class="bSideItem">
<h3 class="sideItemTitle">Least viewed subjects</h3>
<?php
$ratings = read_least_rated();
foreach( $ratings as $r){
$NewItem = Item_get_by_ID( $r[0] );
if ($NewItem ) {
$permalink = $NewItem->gen_permalink( '', '', false, '&' );
$title = $r[2];
if (strlen($title) > 30) {
$title = substr($title,0,30)."...";
}
else {}
}else{}
echo "<a href=\"".$permalink."\">".$title."</a> (".$r[1].")<br />\r\n";
}
?>
</div>
Sorry for my silly Q, i am a PHP newbie
How to Create Table to b2evo DB ??
thanks in advance