Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Got Depreciated Code Error. Help a Newbie...
Old 03-31-2008, 06:13 PM Got Depreciated Code Error. Help a Newbie...
VelvetWood's Avatar
Novice Talker

Posts: 7
Name: Velvet Wood
Location: ... in the moment.
Trades: 0
I'm trying to link Simplog entries to my testing website as the content/text. I'm a real newbie at PHP. I don't write the code. I'm just trying to implement it in a website. I don't know what is meant by the error I'm getting: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of marker_sub().
The testing web page is http://www.redlavalamp.info

Help!
VelvetWood is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-31-2008, 06:39 PM Re: Got Depreciated Code Error. Help a Newbie...
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
try finding an updated script or something similar that does what your looking for. Or rewrite the script but since you indicated your new to php you may need to find either updated or a different script. Something that is compatible with php 5
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
Old 03-31-2008, 06:45 PM Re: Got Depreciated Code Error. Help a Newbie...
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
"Deprecated" means that it is no longer used. Many people do make the make of saying "depreciated" which means lost value.

If you provided the code, then it'd be easier to proffer assistance.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 03-31-2008, 07:56 PM Re: Got Depreciated Code Error. Help a Newbie...
VelvetWood's Avatar
Novice Talker

Posts: 7
Name: Velvet Wood
Location: ... in the moment.
Trades: 0
This is the code on the index.php page.

<?php
if(!file_exists("simplog/config.php")) {
echo "config.php file does not exist";
header("Location: simplog/install.php");
exit(0);
}

session_start();
require_once("simplog/lib.php");
require_once("simplog/class.BlogInfo.php");
require_once("simplog/class.BlogEntry.php");

$blogid = $_GET['blogid'];
if(!isset($blogid)) {
$blogid = 2;
}

$blogInfo = new BlogInfo($blogid);

//include("simplog/header.php");
?>


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Red Lava Lamp - Home</title>
<link href="/redlava.css" rel="stylesheet" type="text/css">
</head>
<body>
<div align="center"><img src="masthead.gif" alt="under construction" width="600" height="288"></div>
<table align="center" width="600" border="0" cellpadding="8" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td>
<?php
$limit = 1;
include("simplog/blog.php");
?>
</td>
</tr>
</table>
</body>
</html>
VelvetWood is offline
Reply With Quote
View Public Profile
 
Old 03-31-2008, 08:01 PM Re: Got Depreciated Code Error. Help a Newbie...
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
You'll need to search through your files for fuction marker_sub and provide that code for us to be able to help. We'll need the entire function to be able to maximally assist.

Also, please use code tags to make the code on the forum a bit nicer to read.

Thanks.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 03-31-2008, 08:41 PM Re: Got Depreciated Code Error. Help a Newbie...
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Quote:
You'll need to search through your files for fuction marker_sub
A small typo that I do all the time.

it's not "fuction", but "function" that you have to look for.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 03-31-2008, 08:44 PM Re: Got Depreciated Code Error. Help a Newbie...
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Good catch. See, if I had used code tags, I'd have caught that. And, to think I skipped it b/c it was inline.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 03-31-2008, 09:10 PM Re: Got Depreciated Code Error. Help a Newbie...
VelvetWood's Avatar
Novice Talker

Posts: 7
Name: Velvet Wood
Location: ... in the moment.
Trades: 0
Here's the whole code with function marker_sub in it...

#
# marker_sub - does substitution for markers, links, emails in templates
#
function marker_sub($line,&$blogEntry,&$blogInfo) {

global $act, $keyw, $trans, $format, $comment_win, $enable_smilies,$baseurl;

if(preg_match("/preview\.php/",$_SERVER['SCRIPT_NAME'])) {
if($_REQUEST['trans']) {
$blogEntry->entryBody = stripslashes(str_to_link($blogEntry->entryBody));
}
}
VelvetWood is offline
Reply With Quote
View Public Profile
 
Old 03-31-2008, 09:27 PM Re: Got Depreciated Code Error. Help a Newbie...
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
try wrapping it with the php tags so people dont complain alot about it

PHP Code:
#
# marker_sub - does substitution for markers, links, emails in templates
#
function marker_sub($line,&$blogEntry,&$blogInfo) {
global 
$act$keyw$trans$format$comment_win$enable_smilies,$baseurl;

if(
preg_match("/preview\.php/",$_SERVER['SCRIPT_NAME'])) {
if(
$_REQUEST['trans']) {
$blogEntry->entryBody stripslashes(str_to_link($blogEntry->entryBody));
}

if you do [ php ] before your code and [ / php ] (with out spaces ofcourse) it will out put like above

btw i think your problem is the
PHP Code:
str_to_link 
A quick search on php.net turned up nothing. never seen that function b4
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1

Last edited by amw_drizz; 03-31-2008 at 09:32 PM..
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
Old 03-31-2008, 11:50 PM Re: Got Depreciated Code Error. Help a Newbie...
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Thanks Jon for pointing out the code thing. I'm one of those people that don't answer questions if code tags aren't used.

The solution to this problem should be changing the first line of the function to
PHP Code:
function marker_sub($line,$blogEntry,$blogInfo) { 
The ampersands aren't necessary in PHP 5 and will throw the error shown. I needed to see the rest of the function in order to determine if the answer could be as simple as simply removing the ampersands. Sometimes other code needs to be adjusted.

BTW: The documentation is at http://us3.php.net/manual/en/languag...ences.pass.php and you'll notice that it does address the deprecation issue.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Reply     « Reply to Got Depreciated Code Error. Help a Newbie...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.30885 seconds with 12 queries