Ok, I don't know if anyone can help me but I am using PHP templates to make a site. I am a newbie and so I am finding this quite difficult so I thought I would ask some folks much better than me.
I have two pages at work here; profile.tpl and profile.php.
The profile page has <Zone> tags in it. I am attempting to pulll a list of contacts from the database and display the picture and user information. This part works fine.
The part I am having trouble with is displaying a different zone if there are no users to associated with the current profile.
I am using a if statement to do this (I did not write this if statement so forgive my ignorance about how it works) and I want an else to take place if there is no contacts that will display an alternative zone.
This is the code from the profile template page:
<ZONE contactsTab enabled>
<div class="dashContent">
<LOOP contactEntity>
<div style="float:left;">
<a href="?L=users.profile&id={contact.id}">
<img src="system/image.php?file={contact.mainpicture}" alt="[Picture {150}]" hspace="2" border="0" id="picture" /></a>
<br />
<a href="?L=users.profile&id={contact.id}">{contact.username}</a></div>
</LOOP contactEntity>
<ZONE addtocontactstab enabled>
<a href="?L=contacts.adduser&id={user.id}">[Add {user.username} to my contacts list {8225}]</a>
</ZONE addtocontactstab enabled>
<div class="clear"></div>
</div>
</ZONE contactsTab enabled>
<ZONE contacts disabled>
<div>This user does not have any contacts at this time.</div>
</ZONE>
This is the code from the supporting PHP page:
$userContactsArray = unpk(_fnc("user", $_GET["id"], "contacts"));
$i=0;
if (is_array($userContactsArray)) foreach($userContactsArray as $userContactGroup => $contactsUsersArray) {
if (is_array($contactsUsersArray)) foreach($contactsUsersArray as $contactsUserID) {
$thirdUserContactsArray = unpk(_fnc("user", $contactsUserID, "contacts"));
if (is_array($thirdUserContactsArray) && _fnc("in_multiarray", $thirdUserContactsArray, $_GET["id"])) {
if ($i==0) $tpl->Zone("contactsTab", "enabled");
$contactEntityArray[$i]["contact.username"] = _fnc("user", $contactsUserID, "username");
$contactEntityArray[$i]["contact.id"] = $contactsUserID;
$contactEntityArray[$i]["contact.mainpicture"] = _fnc("user", $contactsUserID, "mainpicture");
$i++;
}
}
}
else $tpl ->Zone("contacts", "disabled");
if (isset($contactEntityArray)) $tpl -> Loop("contactEntity", $contactEntityArray);
Any help solving this would be more greatly appreciated
If a form submits back to same page do you need to use $get
IM trying to pass page number and year that was selected back to the same page.i have this code Code: echo '<form action="archivedBookings.php" method="get">';
Extracting URL pointer within XML tag
Hi.I'm trying to extract text between two quotation marks in XML. For example, I want to extract:<a href="www.thisisanexample.com">Click here</a>. I want to
Convert .fdf to .pdf
I currently have a web form that uploads the form data to an .fdf file and emails it.However, I just realized that most people I email it to cannot open an .fdf and it needs to be in pdf.Is there any
DateObject and Nulls
Hi all,I have an array mapped to a value object. One of the items in the array is a PHP DateObject, and I need to format this field appropriately.When looping through the array, I pass this field to a
UL and LI Add Form
The idea I want here is when the user click on a character name from the drop down select bar at the bottom of the the form under case 1 and hits Add it is supposed to add it as a new LI in the UL
Problem with PHP/mySQL login code
Hello,There is an error in my login script and I can't figure out what it is...I believe it might be my "SELECT" statement...Can anyone help me? Code: <?php//define ('SASI Services
Format String help
I have a textbox where a person enters an application number. the application number is 10 characters in length:ex: 000012345A0256775434My clients only want to enter in the numbers without the
Syntax Help
Code: im having trouble with that code snippedParse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING
How to use Ajax to verify data on a DB ?
Hello everyone, well i want to know how to check a value if it exists or not on a Data base and capturing this without making postback (no click on a button or other control) ofcourse by using Ajax,
unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_
Can anyone view my code and tell me why im getting the error:Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in