Trouble with Concrete5 Integration
#1
I have given up on login integration, but I still need to be able to show recent forum posts, and the DVZ Shoutbox on my website. I am using the method of....

<?php
$rel = "forum/"; // The directory to your forum--relative to this file's location; include ending slash
chdir($rel);
require("./global.php");
?>

I am getting this error however,

Fatal error: Call to a member function simple_select() on a non-object in /homepages/20/d574760247/htdocs/BLST_Website/concrete5.6.3.3/forums/inc/class_datacache.php on line 117

I have seen a couple instance where people had this error, but no answers on what needed to be done to fix it.

Any help would be greatly appreciated. Thank you.
Reply
#2
100 views and nobody has any ideas? Sad
Reply
#3
Weird, looks like the database variable isn't initialised. Is the code you posted above the full code?
Reply
#4
yeah. That is just the code thats supposed to make you able to put features from the forum on your other pages. I made sure to remove all the other stuff (like code calling for the shoutbox or recent posts) out and only have this so that I could troubleshoot and make sure i knew where the problem was, but even just this is giving the error.  The only thing ive ever seen in reply to this error said it was because of $db being used in both the forum and cms and to fix it to use the mybbintegrator from php dave to fix it, but i tried using that and i still get this same error.

I feel like this is probably something simple to fix but I just dont have the experience. As I said i am using concrete5 cms so I dont know if maybe that is screwing it up somehow???
Reply
#5
I'm not sure, as I haven't used concrete5 before. The issue may well be caused by variable naming or another issue. Could you try editing the above code to the following:

<?php

defined('IN_MYBB') or define('IN_MYBB', 1);
require_once('./forum/global.php');

var_dump($db);

Then you should see a load of debug information about the database object. If you paste that output, we can see if there's anything out of the ordinary.
Reply
#6
(2015-05-16, 09:32 PM)Euan T Wrote: I'm not sure, as I haven't used concrete5 before. The issue may well be caused by variable naming or another issue. Could you try editing the above code to the following:



<?php

defined('IN_MYBB') or define('IN_MYBB', 1);
require_once('./forum/global.php');

var_dump($db);

Then you should see a load of debug information about the database object. If you paste that output, we can see if there's anything out of the ordinary.

just adding the "var_dump($db);" did not change the error message. Removing the ",1" from the "define('IN_MYBB', 1)" changed the error to...



Warning: define() expects at least 2 parameters, 1 given in /homepages/20/d574760247/htdocs/BLST_Website/concrete5.6.3.3/themes/BLSTC5/default.php on line 2
Direct initialization of this file is not allowed.

Please make sure IN_MYBB is defined.
Reply
#7
Yes, that's because the define() method requires the second parameter.

What was the output of the var_dump? What was the object type?
Reply
#8
where was I supposed to be looking for the output...??? I'm sorry, but I have very little experience with php .
Reply
#9
It should be at the top of any page using the file you're editing (and the same page as the error is occurring). If you send me your URL, I can take a look and see the output for myself.
Reply
#10
the error is the only thing that shows on the page...

http://bluesteelguards.com/concrete5.6.3.3/index.php


and even when you "view source" it only shows the error.. ???? I don't get that.

but here is the source for the index... and below the line in the "class_datacache.php" page it is refering to.



<?php
define("IN_MYBB", 1); 
require($_SERVER["DOCUMENT_ROOT"] . "/concrete5.6.3.3/forums/global.php");
var_dump($db); 
?> 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
	   

<html>
<head> 

	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />

	<link rel="stylesheet" type="text/css" href="<?php echo $this->getThemePath()?>/style.css">
	
	<!-- Insert Meta --><meta><!-- End Meta -->
	
	<?php Loader::element('header_required'); ?>
	<?php Loader::element('footer_required'); ?>
	
</head>
<body>

	<table class="container">
		<tr>
			<td class="headerpadding">
			
			</td>
		</tr>
		<tr>
			<td class="nav">
				
				<table>
					<tr>
						<td class="navpadding">
							<a name="Home" class="nav" href="/concrete5.6.3.3/index.php/">Home</>
						</td>
						<td class="navpadding">
							<a name="News" class="nav" href="/concrete5.6.3.3/index.php/news">News</>
						</td>
						<td class="navpadding">
							<a name="Roster" class="nav" href="/concrete5.6.3.3/index.php/roster">Roster</>
						</td>
						<td class="navpadding">
							<a name="Forums" class="nav" href="/concrete5.6.3.3/forums/index.php">Forums</>
						</td>
						<td class="navpadding">
							<a name="Calendar" class="nav" href="/concrete5.6.3.3/forums/calendar.php">Calendar</>
						</td>
						<td class="navpadding">
							<a name="Gallery" class="nav" href="/concrete5.6.3.3/index.php/gallery/">Gallery</>
						</td>
					</tr>
				</table>

			</td>

		</tr>
		<tr>
			<td>
				<table class="content">
					<tr>
						<td class="left">
							
							<table class="tborder" border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td class="header">
										Membership
									</td>
								</tr>
								<tr>
									<td class="side">
										<?php $a = new Area('Membership');$a->display($c);?>
									</td>
								</tr>
							</table>

							<table class="tborder" border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td class="header">
										Latest Forum Posts
									</td>
								</tr>
								<tr>
									<td class="side">
										Recent forum post title <br /> Recent forum post details<br /> 
										Recent forum post title <br /> Recent forum post details<br /> 
										Recent forum post title <br /> Recent forum post details<br /> 
										Recent forum post title <br /> Recent forum post details<br /> 
										Recent forum post title <br /> Recent forum post details<br /> 
										Recent forum post title <br /> Recent forum post details<br /> 
										Recent forum post title <br /> Recent forum post details<br /> 
										Recent forum post title <br /> Recent forum post details
									</td>
								</tr>
							</table>
							
							<table class="tborder" border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td class="header">
										Game News
									</td>
								</tr>
								<tr>
									<td class="side">
										<!-- start feedwind code -->
										<script type="text/javascript">// <![CDATA[
											document.write('\x3Cscript type="text/javascript" src="' + 
											('https:' == document.location.protocol ? 'https://' : 'http://') + 
											'feed.mikle.com/js/rssmikle.js">\x3C/script>');
											// ]]>
										</script>
										<script type="text/javascript">// <![CDATA[
											(function() {var params = {rssmikle_url: "http://www.gameinformer.com/b/MainFeed.aspx?Tags=news",
											rssmikle_frame_width: "225",rssmikle_frame_height: "400",frame_height_by_article: "0",rssmikle_target: "_blank",
											rssmikle_font: "Arial, Helvetica, sans-serif",rssmikle_font_size: "12",rssmikle_border: "off",responsive: "off",
											rssmikle_css_url: "",text_align: "left",text_align2: "left",corner: "off",scrollbar: "on",autoscroll: "on",
											scrolldirection: "down",scrollstep: "5",mcspeed: "20",sort: "Off",rssmikle_title: "off",rssmikle_title_sentence: "",
											rssmikle_title_link: "",rssmikle_title_bgcolor: "#0066FF",rssmikle_title_color: "#FFFFFF",rssmikle_title_bgimage: "",
											rssmikle_item_bgcolor: "#181818",rssmikle_item_bgimage: "",rssmikle_item_title_length: "55",
											rssmikle_item_title_color: "#d2b559",rssmikle_item_border_bottom: "on",rssmikle_item_description: "on",
											item_link: "off",rssmikle_item_description_length: "200",rssmikle_item_description_color: "#FFFFFF",
											rssmikle_item_date: "gl1",rssmikle_timezone: "Etc/GMT",datetime_format: "%b %e, %Y %l:%M:%S %p"
											,item_description_style: "text+tn",item_thumbnail: "full",item_thumbnail_selection: "auto",article_num: "15",
											rssmikle_item_podcast: "off",keyword_inc: "",keyword_exc: ""};feedwind_show_widget_iframe(params);})();
											// ]]>
										</script>
										<div style="font-size: 10px; text-align: center; width: 225px;">
											<a style="color: #cccccc;" href="http://feed.mikle.com/" target="_blank">RSS Feed Widget</a> 
											<!--Please display the above link in your web page according to Terms of Service.-->
										</div>
										<!-- end feedwind code -->
									</td>
								</tr>
							</table>

							
						</td>
						<td class="center">
						
							<?php $a = new Area('MainContent');$a->display($c);?>					
							
						</td>
						<td class="right">
						
							<table class="tborder" border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td class="header">
										Shoutbox
									</td>
								</tr>
								<tr>
									<td class="side">
										insert the shoutbox here
										insert the shoutbox here
										insert the shoutbox here
										insert the shoutbox here
										insert the shoutbox here
										insert the shoutbox here
										insert the shoutbox here
										insert the shoutbox here
										insert the shoutbox here
										insert the shoutbox here
										insert the shoutbox here
										insert the shoutbox here
										insert the shoutbox here
										insert the shoutbox here
									</td>
								</tr>
							</table>
							
							<table class="tborder" border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td class="header">
										Teamspeak
									</td>
								</tr>
								<tr>
									<td class="side">
										<div id="ts3viewer_1064289" style="width:; background-color:;"> </div>

										<script type="text/javascript" src="http://static.tsviewer.com/short_expire/js/ts3viewer_loader.js"></script>

										<script type="text/javascript">
										<!--
										var ts3v_url_1 = "http://www.tsviewer.com/ts3viewer.php?ID=1064289&text=000000&text_size=12&text_family=1&js=1&text_s_weight=bold&text_s_style=normal&text_s_variant=normal&text_s_decoration=none&text_s_color_h=525284&text_s_weight_h=bold&text_s_style_h=normal&text_s_variant_h=normal&text_s_decoration_h=underline&text_i_weight=normal&text_i_style=normal&text_i_variant=normal&text_i_decoration=none&text_i_color_h=525284&text_i_weight_h=normal&text_i_style_h=normal&text_i_variant_h=normal&text_i_decoration_h=underline&text_c_weight=normal&text_c_style=normal&text_c_variant=normal&text_c_decoration=none&text_c_color_h=525284&text_c_weight_h=normal&text_c_style_h=normal&text_c_variant_h=normal&text_c_decoration_h=underline&text_u_weight=bold&text_u_style=normal&text_u_variant=normal&text_u_decoration=none&text_u_color_h=525284&text_u_weight_h=bold&text_u_style_h=normal&text_u_variant_h=normal&text_u_decoration_h=none";
										ts3v_display.init(ts3v_url_1, 1064289, 100);
										-->
										</script>
									</td>
								</tr>
							</table>

							<table class="tborder" border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td class="header">
										Donate via Paypal
									</td>
								</tr>
								<tr>
									<td class="side">
										<center>
											Help keep the Website & Teamspeak running!	
											<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
											<input type="hidden" name="cmd" value="_s-xclick">
											<input type="hidden" name="hosted_button_id" value="N5H2GDATNHFK2">
											<input type="image" src="/images/paypal.png" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
											</form>
										<center>
									</td>
								</tr>
							</table>							

							
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td>

				<table class="tborder" border="0" cellspacing="0" cellpadding="0">
				<tbody>
					<tr>
						<td class="header">
							Contact Us 
						</td>
					</tr>
					<tr>
						<td class="footer">

							<table cellspacing="0" cellpadding="0">
								<tr>
									<td name="contact">
										
										<p><span><strong>Contact Us:</strong></span></p>
										<p>Guild Leader: [email protected]</p>
										<p>Webmaster: [email protected]</p>
										
									</td>
									<td class="info">
									
										<p>Privacy Policy</p>
										<p>User Agreement</p>
										
									</td>										
								</tr>
								<tr>
									<td name="copyright" colspan="2">
									
										<p>Copyright © 2015 bluesteelguards.com. All rights reserved.</p>
										
									</td>
								</tr>
							</table>
										
						</td>
					</tr>
				</tbody>
				</table>			
				
			</td>
		</tr>
	</table>

	
	
</body>
</html>




Quote: else

{
// Database cache
$query = $db->simple_select("datacache", "title,cache");
while($data = $db->fetch_array($query))
{
$this->cache[$data['title']] = unserialize($data['cache']);
}
}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)