Welcome to Geeklog, Anonymous Saturday, April 20 2024 @ 10:16 am EDT

Geeklog Forums

Missing argument 1 for phpblock_custom


Nathan Burke

Anonymous
Hi.
I am changing hosts, and in doing so decided to upgrade to geeklog 1.4.0 SR 5-1 I did a fresh install, and everything worked perfectly........until I got to the custom blocks.

In my previous installation, all my custom blocks worked fine. Using the exact same code in lib-custom.php, my blocks work, but I get an error at the top of the page:
Text Formatted Code
Missing argument 1 for phpblock_custom__getquote() in /home/somewhere/public_html/blog/system/lib-custom.php on line 449
 


So, the blocks are actually working correctly, but for some reason that error appears. Here's my code directly from lib-custom.php...the first line is line 449 from the error.:

Text Formatted Code
function phpblock_custom_getquote($custom_getquote) {
$db = mysql_connect("localhost", "login", "******");
mysql_select_db("*******", $db);
$numStories = 6;

    $result = mysql_query("SELECT * FROM items WHERE items.quote <>'' AND date2<=curdate() ORDER BY ID DESC LIMIT 1");
    $nrows = mysql_num_rows($result);  
    for ($i = 1; $i <= $nrows; $i++) {
        $A = mysql_fetch_array($result);
                $B = ($A['quote']);
                $C = htmlspecialchars($B);
                //if there's only one quote:
                if ($A['quote2']==''){
                $retval .= '“<b>'. stripslashes($A['quote']).'</b>”<br>';
        $retval .=  '-<i>' . stripslashes($A['qsource']) .  '</a> ';
                $retval .='<a href="'.$A['link1'].'">...Full Story</a></i><br><br>';
                }
                //If there is a second quote
if ($A['quote2'] <> ''){
//If there's a second quote and both quotes come from different stories

if ($A['qlink2'] <> ''){
$retval .= '“<b>'. stripslashes($A['quote']).'</b>”<br>';
        $retval .=  '-<i>' . stripslashes($A['qsource']) .  '</a> ';
                $retval .='<a href="'.$A['link1'].'">...Full Story</a></i><br><br>';
$retval .= '“<b>'. stripslashes($A['quote2']).'</b>”<br>';
        $retval .=  '-<i>' . stripslashes($A['qsource2']) .  '</a> ';
                $retval .='<a href="'.$A['qlink2'].'">...Full Story</a></i><br><br>';

}
//If there's a second quote and both quotes go to the same story
if ($A['qlink2']==''){
$retval .= '“<b>'. stripslashes($A['quote']).'</b>”<br>';
        $retval .=  '-<i>' . stripslashes($A['qsource']) .  '</a> ';
                $retval .='<a href="'.$A['link1'].'">...Full Story</a></i><br><br>';
$retval .= '“<b>'. stripslashes($A['quote2']).'</b>”<br>';
        $retval .=  '-<i>' . stripslashes($A['qsource2']) .  '</a> ';
                $retval .='<a href="'.$A['link1'].'">...Full Story</a></i><br><br>';

}
}
 
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
function phpblock_custom_getquote($custom_getquote) {

You have to get rid of $custom_getquote. phpblock functions do not take any parameters. When you enter the name of the function in the block form, you just put phpblock_custom_getquote in the box. No parentheses.

I do have a hack somewhere that allows there to be parameters. I'll see if I can dig it up.
 Quote

Nathan Burke

Anonymous
Thanks so much! That worked perfectly!
 Quote

All times are EDT. The time is now 10:16 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content