Jump to content

MxGucci

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

MxGucci's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I used an open source code for a 5 star rating system and it works perfectly fine, however I didn't realize when customizing the code to suite my needs that it would refresh the entire page when user rated something, this really annoys me and will bother some of my users. I have hear jquery would help me out with this but I have no concept of it and don't understand most terminology from the tutorials they have on their site. Does anyone just have a simple method of having this script refresh everytime someone clicks on the page rather having to refresh the page. Should I paste the whole code or just the part that echo's the star rating onto the page? Here is how I put it onto my page: include("include/rate.php"); // 5 star rating system echo ' <tr><td background="imgs/menu_master_gfx.gif" align="center" class="left_top_right_border"> <font class="table_title"> User Ratings </td></tr> <tr><td bgcolor="FFFFFF" align="center" class="left_right_border"> <font class="inside_text">'; writeRate($poker_room_field); echo '<p style="margin-top: 0; margin-bottom: 0"> <img border="0" width="0" height="4"></p> </td></tr>'; I think you all might need the entire code as maybe I have to edit some stuff there, but if anyone could possibly fix this for me, I'd greatly appreciate it. For a working example of the script please go to : www.tiltnation.com/beta/reviews.php?site=pokerstars and you'll see the star rating under "USER RATINGS". Test it out and you'll notice it refreshes the entire page. Can someone please help?!
  2. Thank you sir, I'll test it out and I'll get back to you guys if I face any problems.
  3. I am at work right now, don't have access to my code but I have a small 5 star rating script, which is php/mysql based, when I run the script on my page, and if the user clicks on a star and rates the script, it refreshes the whole page, although fast its pretty annoying, is there any way to run scripts within an iframe or something? Sorry if my question doesnt make sense or if you all need the code before hand to answer. I will upload the code once I get home. Thanks, Gucci
  4. Not bad man, I won't mind giving you credit if I do use your script. Is it fully complete yet?
  5. Hi, I am in the midst of making an online community website for poker players, however I don't have the php/mysql skills it takes to build a membership section which will allow users to sign up for an account, have a unique profile page where they can add content, allow to access pages that need authentication and so forth. I am sure you understand what I want, basically a section for my members like those big online social network sites, but it doesn't have to be that upscale and user friendly, just simple. If anyone has any scripts or tutorials, I would prefer a script as most tutorials will speak in terms which will only make me want to puke, if anyone can assist me in accomplishing this, I will greatly appreciate it. I am even willing to pay someone or purchase a software, only after I try it out and fully have it adapted to my website and have the ability to keep on expanding to my needs. I have found numerous user authentication scripts on hotscripts.com, however most only just have simple basic user sign up pages with login forms, no profile page, or any other user interactivity -- can someone tell me why this is? Is it because the creators of such scripts want to leave the utilization of functions up to the webmasters and just give them the tool for user authentication? Anyways, sorry for the lengthy e-mail, any and all suggestions and comments are welcome. I hope someone can assist me. Thanks for your time, Gucci
  6. Below is the code which I am using to read information from a flat file database, the script below functions properly (..index.php?site=1 .. brings up the first line in my flat file database and so forth).. <?php $fileArray = file('flat-file-data.txt'); $site = $_GET['site'] - 1; // minus 1 to account for array index. if (isset($fileArray[$site])) { list ($field1, $field2, $field3, $field4, $field5, $field6) = split ('\|', $fileArray[$site]); echo ' <table border="0"> <tr> <td>'.$field1.'</td> <td>'.$field2.'</td> <td>'.$field3.'</td> <td>'.$field4.'</td> <td>'.$field5.'</td> <td>'.$field6.'</td> </tr></table>'; }else { echo 'That line does not exist'; } ?> My question is, is there any possible way to amend the above script so I can retrieve information line by line but by directing my visitors to a text link such as (..index.php?site=pokerstars) instead of having (..index.php?site=1), could someone assist me in doing this? I want to be able to define my own site name on each line, could we do this by storing a field that will contain the site name I want to use, and the script will some how read that line and direct my visitors to read from the line? I am so sorry for making this question so confusing, I hope one of you helpful php guru's might help out a lost soul. Thanks, Gucci
  7. Hi, The script below is suppose to create a horizontal bar graph, however the owner of the script didn't give any documentation on how to proceed with using this script to create graphs. The example he gave on his site doesnt make much sense. I will paste it after the script. Can someone please help me create a graph.php file where it'll graph the example he put on his site. <?php /** * lwtCSSMiniChars. * Version 0.1 * Copyright (C) 2008 Vassilis Dourdounis. * http://projects.littlewebthings.com/cssminicharts/ * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ /** * Renders a Horizontal Bar Chart * Returns html string. * * @param (array) data * @param (array) options */ function lwtMiniHorizontalBarChart($data, $options=null) { $width = $options['width'] ? $options['width'] : 100; $height = $options['height'] ? $options['height'] : 20; $show_grid = $options['show_grid'] ? $options['show_grid'] : true; $scale = $options['scale'] ? $options['scale'] : 100; $grid_width = $options['grid_width']? $options['grid_width'] : 10; $default_colors = array('#dec', '#e88'); $ret .= '<div class="lwtMiniBarChart" style="position: relative; width: '.$width.'px; height: '.$height.'px;">'; $h = $height; // Render grid $grid_w = $width * $grid_width/$scale; if ($show_grid) { for ($i = 0; $i*$grid_w+$i < $width; $i++) { $ret .= '<div style="height: '.$height.'px; border-left: 1px solid #eee; width: 1px; position: absolute; left: '.($i*$grid_w).'px;"></div>'; } for ($i = 0; $i*$grid_w+$i < $width; $i++) { $ret .= '<div style="height: 2px; border-left: 1px solid #333; width: 1px; position: absolute; left: '.($i*$grid_w).'px; bottom: 0px;"></div>'; } } // Render Bars $h = $height * 0.6; $color_pivot = 0; foreach ($data as $color => $value) { if (is_numeric($color)) { $color = $default_colors[$color_pivot++ % count($default_colors)]; } $ret .= '<div style="background-color: '.$color.'; position: absolute; width: '.($value/$scale*100).'%; height: '.$h.'px; top: '.(($height-$h)/2).'px; padding: 0; margin: 0; left: 0;"></div>'; $h *= 0.5; } $ret .= '</div>'; return $ret; } Example: lwtMiniHorizontalBarChart( array( 'blue' => 90, 'white' => 40, 'red' => 20 ), array( 'width' => 300, 'height' => 40 ) ); PLEASE HELP!!
  8. Hi, I found a very neat and small vertical graph chart script on the net, however the owner of the script didn't give much explanation on how to use the script. Below is the actual code he gives on his website (http://projects.littlewebthings.com/cssminicharts/) : <?php /** * lwtCSSMiniChars. * Version 0.1 * Copyright © 2008 Vassilis Dourdounis. * http://projects.littlewebthings.com/cssminicharts/ * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ /** * Renders a Horizontal Bar Chart * Returns html string. * * @param (array) data * @param (array) options */ function lwtMiniHorizontalBarChart($data, $options=null) { $width = $options['width'] ? $options['width'] : 100; $height = $options['height'] ? $options['height'] : 20; $show_grid = $options['show_grid'] ? $options['show_grid'] : true; $scale = $options['scale'] ? $options['scale'] : 100; $grid_width = $options['grid_width']? $options['grid_width'] : 10; $default_colors = array('#dec', '#e88'); $ret .= '<div class="lwtMiniBarChart" style="position: relative; width: '.$width.'px; height: '.$height.'px;">'; $h = $height; // Render grid $grid_w = $width * $grid_width/$scale; if ($show_grid) { for ($i = 0; $i*$grid_w+$i < $width; $i++) { $ret .= '<div style="height: '.$height.'px; border-left: 1px solid #eee; width: 1px; position: absolute; left: '.($i*$grid_w).'px;"></div>'; } for ($i = 0; $i*$grid_w+$i < $width; $i++) { $ret .= '<div style="height: 2px; border-left: 1px solid #333; width: 1px; position: absolute; left: '.($i*$grid_w).'px; bottom: 0px;"></div>'; } } // Render Bars $h = $height * 0.6; $color_pivot = 0; foreach ($data as $color => $value) { if (is_numeric($color)) { $color = $default_colors[$color_pivot++ % count($default_colors)]; } $ret .= '<div style="background-color: '.$color.'; position: absolute; width: '.($value/$scale*100).'%; height: '.$h.'px; top: '.(($height-$h)/2).'px; padding: 0; margin: 0; left: 0;"></div>'; $h *= 0.5; } $ret .= '</div>'; return $ret; } /** * Renders a Vertical Bar Chart * Returns html string. * * @param (array) data * @param (array) options */ function lwtMiniVerticalBarChart($data, $options=null) { $width = $options['width'] ? $options['width'] : 100; $height = $options['height'] ? $options['height'] : 20; $show_grid = $options['show_grid'] ? $options['show_grid'] : true; $colors = $options['colors'] ? $options['colors'] : array('#e88', '#b55'); $ret .= '<div class="lwtMiniBarChart" style="position: relative; width: '.$width.'px; height: '.$height.'px;">'; $w = max(1, floor(($width-count($data))/count($data))); $i = 0; foreach ($data as $value) { $ret .= '<div style="background-color: '.$colors[$i%count($colors)].'; position: absolute; width: '.($w).'px; height: '.($value/max($data)*$height).'px; left: '.($i*$w + $i).'px; bottom: 0px;"></div>'; $i++; } $ret .= '</div>'; return $ret; } ?> He then goes and gives us 2 exampls but doesnt give us actual information on how to use the script. lwtMiniHorizontalBarChart( array( 'blue' => 90, 'white' => 40, 'red' => 20 ), array( 'width' => 300, 'height' => 40 ) ); That is the graph I want to draw, well for now because I will eventually customize it. However, if any of you have an easier php script that will allow me to draw a simple horizontal graph, all I need is a vertical line graph (kind of how voting polls have it), all I want to do is say 9/10 and have the graph load a graph that is 9/10 full, then another graph under it as 5/10 and so forth, if someone can give me a simpler easier script that I can my self insert into my pages whenever I need to make a mini graph of 9/10 and 5/10, etc, I'd greatly appreciate it. Sorry for the messy question and lengthy question. Thanks, Gucci
  9. SIR, THANK YOU SO MUCH FOR YOUR HELP!! I have spent hours, and hours, and HOURS, trying to figure this out. Kudos to you pal!
  10. The code you gave me doesn't work, unless I am using it wrong, am I suppose to direct my page ..get.php?=X or something to retrieve the line I want? I am so sorry for being so confusing. Thanks for your help
  11. So there is no option in getting my code that I've pasted above to work in the way I want it?
  12. Hi, I understand a lot of you would recommend I use mysql, however I have limited mysql databases, and all I need is to retrieve some information from a flat file which will contain about 10-20 lines of data. I have found a tutorial on the net that explained how to read from a flat file and echo it onto the page, however; now my problem is how do I specifically choose the page to show only from a line of my choice from the database. Here is the code I have used (get.php): <?php $fp = fopen('flat-file-data.txt','r'); if (!$fp) {echo 'ERROR: Unable to open file.</table></body></html>'; exit;} while (!feof($fp)) { $line = fgets($fp, 1024); //use 2048 if very long lines list ($field1, $field2, $field3, $field4, $field5, $field6) = split ('\|', $line); echo ' <table border="0"> <tr> <td>'.$field1.'</td> <td>'.$field2.'</td> <td>'.$field3.'</td> <td>'.$field4.'</td> <td>'.$field5.'</td> <td>'.$field6.'</td> </tr></table>'; $fp++; } fclose($fp); ?> Here is the flat file (flat-file-data.txt): row 1 cell 1|row 1 cell 2|row 1 cell 3|row 1 cell 4|row 1 cell 5|row 1 cell 6 row 2 cell 1|row 2 cell 2|row 2 cell 3|row 2 cell 4|row 2 cell 5|row 2 cell 6 row 3 cell 1|row 3 cell 2|row 3 cell 3|row 3 cell 4|row 3 cell 5|row 3 cell 6 row 4 cell 1|row 4 cell 2|row 4 cell 3|row 4 cell 4|row 4 cell 5|row 4 cell 6 row 5 cell 1|row 5 cell 2|row 5 cell 3|row 5 cell 4|row 5 cell 5|row 5 cell 6 /// (test the page at www.tiltnation.com/beta/test/get.php) Basically, I want to be able to have get.php do some sort of query string which will display to my visitor the line of their choice, this script is being used to review some websites, so I want to be able to do get.php?page=1 and it'll show only the data from line 1 and so forth. I am sure this isn't as easy as I expect but if anyone can either help give me a tutorial they have read or written, or a small snippet that I can look at, or even help create a simple version of what I want, it would be much appreciated. Thanks, Gucci
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.