Yii2 doesn't work yii2-poll-widget - yii2

I use yii2-poll-widget on my page.
I installed it:
php composer.phar require "pollext/poll":"dev-master"
And write on my page:
<?php
use pollext\poll\Poll;?>
<?php
echo Poll::widget([
'pollName'=>'Do you like PHP?',
'answerOptions'=>
[
'Yes',
'No',
],
]);
?>
But I get error:
Unknown Property – yii\base\UnknownPropertyException
Setting unknown property: pollext\poll\Poll::pollStatus
How can I solve my problem?

I do not recommend pollext/poll because it contains multiple errors in its core code, like missing ) or undefined index. We (I and 2 more people) tried to fix errors in its core files by hand (I know we shouldn't do that as it's a widget, sitting in vendor directory but at least we could see if it works at all).
You can try to use this code below (what we added/modified is not much, we did more to improve design and functionality but still wasn't good enough, not worth to continue):
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use pollext\poll\AjaxSubmitButton;
use yii\helpers\Url;
?>
<style>
.poll{
display: inline-block;
margin-top: 10px;
margin-bottom: 10px;
background: #ffffff;
}
.poll label{
width: 100%;
font-size: 10pt;
font-weight: bold;
display: block;
color: #464646;
}
.poll label:hover{
cursor: pointer;
}
.poll button[type="submit"]{
font-weight: bold;
font-size: 10pt;
margin-top: 10px;
color: #4682B4;
}
.poll-option-name{
font-weight: bold;
font-size: 10pt;
color: #464646;
}
.per_container{
font-weight: bold;
font-size: 10pt;
color: #464646;
padding: 0;
margin: 0;
max-width: 50px;
}
.support_forms button[type="submit"]{
border: none;
font-weight: normal;
color: #4682B4;
margin-left: 0;
padding: 0;
background: #ffffff;
}
.support_forms button[type="submit"]:hover{
text-decoration: underline;
}
.support_forms button[type="submit"]:focus{
outline: none;
border: none;
}
.support_forms{
margin-top: 0;
}
</style>
<div class="poll" style="width:<?php echo $params['maxLineWidth']+55;?>px;" >
<?php echo "<div style=\"max-width:".$params['maxLineWidth']."px; word-wrap: break-word; margin-bottom: 10px; font-size:12pt; font-weight:bold;\">".$pollData['poll_name']."</div>";?>
<?php $pullName = (isset($_POST['nameOfPoll'])) ? $_POST['nameOfPoll'] : '';?>
<?php if((Yii::$app->user->getId()==null && $_POST['pollStatus']!='show' && $isVote == false ) || ($pullName==$pollData['poll_name'] && $_POST['pollStatus']=='vote'&& $_POST['pollStatus']!='show' && Yii::$app->user->getId()==null)){
echo "Sign in to vote";
}?>
<?php if(($isVote == false && Yii::$app->user->getId()!=null && !empty($_POST['pollStatus']) && $_POST['pollStatus'] !='show') || ($pullName==$pollData['poll_name'] && $_POST['pollStatus']=='vote'&& $_POST['pollStatus']!='show' && Yii::$app->user->getId()!=null)){?>
<?php echo Html::beginForm('#', 'post', ['class'=>'uk-width-medium-1-1 uk-form uk-form-horizontal']); ?>
<?php echo Html::activeRadioList($model,'voice',$answers); ?>
<input type="hidden" name="poll_name" value="<?=$pollData['poll_name']?>"/>
<?php AjaxSubmitButton::begin([
'label' => 'Vote',
'ajaxOptions' => [
'type'=>'POST',
'url'=>'#',
'success' => new \yii\web\JsExpression('function(data){
$("body").html(data);
}'),
],
'options' => ['class' => 'customclass', 'type' => 'submit'],
]);
AjaxSubmitButton::end();
?>
<?php echo Html::endForm();
}
?>
<?php if (($isVote == false && !empty($_POST['pollStatus']) && $_POST['pollStatus'] !='show') || (Yii::$app->user->getId()==null && $_POST['pollStatus']!='show') || ($pullName==$pollData['poll_name'] && $_POST['pollStatus']=='vote'&& $_POST['pollStatus']!='show')){?>
<form method="POST" action="" class="support_forms">
<input type="hidden" name="nameOfPoll" value="<?=$pollData['poll_name']?>"/>
<input type="hidden" name="pollStatus" value="show"/>
<?php AjaxSubmitButton::begin([
'label' => 'Show results',
'ajaxOptions' => [
'type'=>'POST',
'url'=>'#',
'success' => new \yii\web\JsExpression('function(data){
$("body").html(data);
}'),
],
'options' => ['class' => 'customclass', 'type' => 'submit'],
]);
AjaxSubmitButton::end();
?>
</form>
<?php }?>
<?php if($isVote == true || ($pullName==$pollData['poll_name'] && $_POST['pollStatus']=='show') ){?>
<?php
for($i = 0; $i<count($answersData); $i++){
$voicesPer = 0;
if($sumOfVoices ==0){
$voicesPer = 0;
}else{
$voicesPer = round($answersData[$i]['value']/$sumOfVoices, 4);
}
$lineWidth = $params['maxLineWidth']*$voicesPer;
?>
<div class="single-line" style="margin-bottom: 10px; ">
<?php echo "<div class=\"poll-option-name\">".$answersData[$i]['answers'].": ".$answersData[$i]['value']."</div>"; ?>
<div style="width: <?php echo $params['maxLineWidth']; ?>px; height: <?php echo $params['linesHeight']; ?>px; background-color: <?php echo $params['backgroundLinesColor']; ?>; ">
<div style="width: <?php echo $lineWidth;?>px; height: <?php echo $params['linesHeight'] ?>px; background-color: <?php echo $params['linesColor']; ?>;">
<div class="per_container" style="display: block; line-height:<?php echo $params['linesHeight'] ?>px; height: <?php echo $params['linesHeight'] ?>px;
position: relative; left:<?php echo $params['maxLineWidth']+5; ?>px; margin: 0;"><?php echo ($voicesPer*100)."%"?></div>
</div>
</div>
</div>
<?php }?>
<?php }?>
<?php if ($isVote == false && !empty($_POST['pollStatus']) && $_POST['pollStatus'] == 'show'){?>
<form method="POST" action="" class="support_forms" style="margin-top: -10px;">
<input type="hidden" name="nameOfPoll" value="<?=$pollData['poll_name']?>"/>
<input type="hidden" name="pollStatus" value="vote"/>
<?php AjaxSubmitButton::begin([
'label' => 'Vote',
'ajaxOptions' => [
'type'=>'POST',
'url'=>'#',
'success' => new \yii\web\JsExpression('function(data){
$("body").html(data);
}'),
],
'options' => ['class' => 'customclass', 'type' => 'submit'],
]);
AjaxSubmitButton::end();
?>
<?php }?>
</form>
</div>
This modified come is taken from pollext/views/index.php file. In case you're wondering how it looks like:
Upper is a view for a person who didn't vote yet and below is a view for a person who have already voted.

Related

why the controller don't read an if function loading the parameters?

this is my create function in my controller:
public function actionCreate()
{
$searchModel = new AutoriSearch();
$model = new Autori();
$model->RIDUtente = Yii::$app->user->getId();
$model->Accettazione='SI';
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
if ($model->load(Yii::$app->request->post()) ) {
$model->modified = date( 'y-m-d' );
$model->creator_aut = Yii::$app->user->getId();
$model->Utenteup_autori = Yii::$app->user->getId();
if ($model->IParte) {
$model->CampoRicerca = $model->IParte." ".$model->IIParte." ".$model->Prefisso." ".$model->Qualificazione." ".$model->IIEnte." ".$model->Sigla;
}
if($model->Accettazione == "" || $model->Accettazione == 'SI' ){
$model->RIDAutore = $model->IDAutore;
}
$model->save();
return $this->redirect(['view', 'id' => $model->IDAutore]);
}
return $this->render('create', [
'model' => $model,
'dataProvider' => $dataProvider,
'searchModel' => $searchModel,
]);
}
The problem is that the record is not saved, and the system don't enter in the if function "if ($model->load(Yii::$app->request->post()) )". So this is a problem. In others controller it gives me no error, for this controller it gives me the error. This is strange. Can anyone help me fast please? It's very important!!!! Thank you.
This is the form:
<div class="autori-form">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
'type' => ActiveForm::TYPE_HORIZONTAL,
]); ?>
<?= $form->field($model, 'IParte', ['labelOptions'=>['style'=>'font-size: 12px;']])->textInput(['maxlength' => true, 'style'=>'width:190px; height: 30px;'])->label('I Parte del nome') ?>
<?= $form->field($model, 'IIParte', ['labelOptions'=>['style'=>'position: relative; top: -63px; left: 360px;font-size: 12px;']])->textInput(['maxlength' => true, 'style'=>' height: 30px; width:190px; position: relative; position: relative; top: -58px; left: 360px;'])->label('Autori:<br>II Parte del nome') ?>
<?= $form->field($model, 'IIEnte', ['labelOptions'=>['style'=>'width: 100px; position: relative; top: -120px; left: 800px;font-size: 12px;']])->textInput(['maxlength' => true, 'style'=>' height: 30px; width:190px; position: relative; top: -116px; left: 800px;'])->label('Enti: Ente subordinato') ?>
<div style="position: relative; top: -120px;">
<?= $form->field($model, 'Prefisso', ['labelOptions'=>['style'=>'font-size: 12px;']])->textInput(['maxlength' => true, 'style'=>' height: 30px; width:300px'])->label('Appellativi o altra parte del nome') ?>
<?= $form->field($model, 'Sigla', ['labelOptions'=>['style'=>'font-size: 12px;']])->textInput(['maxlength' => true, 'style'=>' height: 30px; width:300px'])->label('Sigla dell\'ordine') ?>
<?= $form->field($model, 'Qualificazione', ['labelOptions'=>['style'=>'font-size: 12px;']])->textInput(['maxlength' => true, 'style'=>' height: 30px; width:300px'])->label('Qualificazioni') ?>
<?= $form->field($model, 'Fonte', ['labelOptions'=>['style'=>'font-size: 12px;']])->textInput(['maxlength' => true, 'style'=>' height: 30px; width:300px']) ?>
<?= $form->field($model, 'RIDTipoAutore', ['labelOptions'=>['style'=>'font-size: 12px;']])->dropdownList(
TipiAutore::find()
->select(['TipoAutore'])
->indexBy('IDTipoAutore')
->column(),
['prompt'=>'', 'style'=>' height: 30px; width:300px']
)->label('Tipo Autore') ?>
<?= $form->field($model, 'Accettazione', ['labelOptions'=>['style'=>'font-size: 12px;']])->dropdownList(
Autori::find()
->select(['Accettazione'])
->indexBy('Accettazione')
->column(),
['style'=>' height: 30px; width:300px', 'onchange' => 'accettato(this)']
)->label('Accettazione') ?>
<?php //$form->field($model, 'CampoRicerca')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'RIDUtente')->hiddenInput(['value'=> Yii::$app->user->identity->id])->label(false) ?>
<?= $form->field($model, 'RIDAutore', ['labelOptions'=>['style'=>'font-size: 12px; position: relative; top: -28px;']])->textInput(['maxlength' => true, 'style'=>' height: 30px; width:300px; position: relative; top: -28px;', 'disabled' => true])->label('Forma accettata') ?>
</div>
<a name="button" id="btnMostra" style="position: relative; top: -199px; left: 540px; cursor: pointer;">Clicca per ricercare la forma accettata</a>
<script>
function accettato(select) {
console.log(select,$(select));
$("#autori-ridautore").prop("disabled", $(select).val()!="NO");
}
</script>
<?= Html::hiddenInput( 'modified', strtotime("now") ); ?>
<div class="form-group" style="position: relative; top: -170px; left: 860px; width: 200px;">
<?= Html::submitButton(Yii::t('app', 'Salva'), ['class' => 'btn btn-success']) ?>
<?= Html::a('Annulla', ['autori/index'], ['class'=>'btn btn-info']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
RULES OF Autori.php:
public function rules()
{
return [
[['RIDUtente', 'modified', 'RIDTipoAutore'], 'required'],
[['RIDUtente', 'RIDAutore', 'RIDTipoAutore', 'creator_aut'], 'integer'],
[['IParte', 'IIEnte'], 'string', 'max' => 100],
[['IIParte', 'Qualificazione'], 'string', 'max' => 50],
[['Prefisso'], 'string', 'max' => 30],
[['Sigla'], 'string', 'max' => 10],
[['Accettazione'], 'string', 'max' => 2],
[['CampoRicerca'], 'string', 'max' => 400],
[['Fonte'], 'string', 'max' => 3200],
[['modified'], 'string', 'max' => 8],
];
}
RULES OF AutoriSearch Model:
public function rules()
{
return [
[['IDAutore', 'RIDUtente', 'RIDAutore', 'RIDTipoAutore', 'creator_aut'], 'integer'],
[['autoreMix', 'IParte', 'IIParte', 'Prefisso', 'Qualificazione',
'IIEnte', 'Sigla', 'Accettazione', 'CampoRicerca',
'Fonte', 'modified'], 'safe'],
];
}
your forms method is get but you are getting data by post and this is incompatible
'method' => 'get',
$model->load(Yii::$app->request->post()

CSS issue with div wrapping another

I have a problem that I cannot manage to wrap my section properly.
I have a div "container" that with a php part is populated by few divs and I don't know how to properly wrap it with the border:solid of my created div.
html/php part
<div class = "listaCarrello" id ="listaCarrello "style="display: <?php echo !isset($_GET['riepilogo'])&&isset($_SESSION['username'])? "block":"none"?>">
<?php
$isEmpty = true;
foreach ($_COOKIE as $key => $val) {
$query = $connection->query("SELECT * FROM prodotto WHERE IDProdotto = $key");
if ($query != null) {
$isEmpty = false;
$row = $query->fetch_assoc();
echo "<div class = \"elemCarrello\">";
echo "<p class=\"nomeCarrello\">" . $row['nomeProdotto'] . "</p>";
echo "<div class = \"imgCarrello\">";
echo "<img src = \"img/" . $row['immagine'] . "\" alt=\"" . $row['nomeProdotto'] . "\"height=\"150px\" width=\"150px\">";
echo "</div>";
echo "<div class=\"prezzoCarrello\">";
echo "<p>Prezzo unitario " . $row['prezzo'] . "</p>";
echo "<p> Quantità: " . $val;
echo " - Prezzo totale: ";
echo "€" . $row['prezzo'] * $val . "</p>";
$totale = $totale + ($row['prezzo'] * $val);
echo "<p> Modifica la Quantità: ";
echo "<input type='number' id = 'quantita' name='quantita' value='" . $val . "'>";
echo "<button onclick='refreshCookie($key, document.getElementById(\"quantita\").value)'>AGGIORNA</button>";
echo "</div>";
echo "<button class='eliminaCarrello' onclick='eliminaCookie($key)' style='background: white'> <img src='img/elimina.png' height='50' width='50'> </button>";
echo "</div>";
}
}
?>
</div>
<?php
if (!$isEmpty) {
echo "<div class='checkOut'>";
echo "<p>Totale: €" . $totale . "</p>";
echo '<button id="2ndphase" onclick="goToAddress()">AVANTI</button>';
echo "</div>";
}
?>
css part
.listaCarrello{
border:solid;
border-color: lightgray;
border-radius: 10px;
text-align: center;
margin-top: 5px;
width: 99%;
margin-bottom: 5px;
padding-bottom: 50px;
}
.elemCarrello{
margin-top: 5px;
width: 99%;
text-align: left;
float:left;
display: block;
margin-bottom: 5px;
border: solid;
margin-left: 5px;
border-radius: 10px;
}
.nomeCarrello{
padding-left: 10px;
font-weight: bold;
}
.imgCarrello{
float: left;
padding-left: 10px;
}
.eliminaCarrello{
margin-top: -13px;
margin-bottom: 10px;
}
Sorry for my English and I hope that you understood what I am saying.
I have attached a image as an example
Set the "container" divs overflow styling to auto.
container{
overflow:auto;
}

printing in CSS second page

I keep on searching about this but i didn't find an answer..
I want to print my website page, so i used the margin-top and margin-bottom but it only affected the first sheet.. In the second page, there is no margin on top.. is there a way to do this..
Here is the sample image i am talking about.
Here is the code that I am using. Please help.
<style type="text/css">
.printOnly {
margin-top: 75px;
display: none;
page-break-inside: avoid;
}
.textSummaryTable { page-break-inside:avoid;}
.textSummaryTable tr { page-break-inside:avoid; page-break-after:auto }
#media print {
.summaryTable { page-break-inside: avoid; }
.summaryTable tr:nth-child(odd){ background-color:#E1E4E5; }
.summaryTable tr:nth-child(even) { background-color:#ffffff; }
.printOnly {
display: block;
}
.panel {
border: 1px solid transparent;
padding: 2px;
margin: 0;
}
.textSummaryTable{
border:1px solid gray;
page-break-inside: avoid;
}
.textSummaryTable td{
border:1px solid gray;
page-break-inside: avoid;
}
#main {
overflow: hidden;
position: absolute;
padding: 0px;
height: auto;
width: 100%;
}
#title {
display: none;
}
#line-break {
display: block;
}
.textSummaryTable {
width: 100%;
}
}
#media screen {
#line-break {
display: none;
}
}
</style>
<?php
$this->pageTitle = Yii::app()->name . ' - View Evaluation';
$user = LoginForm::getUser();
?>
<?php
$participants = $modelE->evaluationDetails;
?>
<style type="text/css">
#media print {
body {
overflow: hidden;
}
}
</style>
<div class=" non-printable">
<div class='pull-right non-printable'>
<button id="btnPrint" type="button" class="btn btn-default pull-right" onclick="window.print();">
<span class="glyphicon glyphicon-print"></span> Print
</button>
</div>
<?php
$startDate = date("M j, Y", strtotime($modelE->start_date));
$endDate = date("M j, Y", strtotime($modelE->end_date));
?>
</div>
<div id='line-break'>
<br>
<br>
<br>
</div>
<div class="container-fluid">
<div class="printable">
<h4><?php echo htmlentities($modelE->evaluationForm->name); ?></h4>
<h5><?php echo $startDate; ?> - <?php echo $endDate; ?></h5>
<h5>Candidate: <?php echo htmlentities($modelE->evaluatee); ?></h5>
<h5>Overall Evaluation: <?php echo htmlentities($modelE->getResult()); ?></h5>
<h5>Participants: <?php echo htmlentities(count($participants)); ?></h5>
<div class="panel panel-default">
<div class="panel-body">
<h5><strong>Instructions: </strong> <?php echo htmlentities($modelE->evaluationForm->description); ?></h5>
<!-- <h4>Results Summary</h4> -->
<?php
$radioFlag = false;
foreach ($modelE->evaluationForm->evaluationFormDetails as $question) {
$criteria = new CDbCriteria;
$criteria->with = 'evalResult';
$criteria->addInCondition('eval_form_question_id', array($question->id));
$criteria->addInCondition('evalResult.eval_id', array($modelE->id));
$resultSet = EvaluationResultsDetails::model()->findAll($criteria);
if ( strtolower($question->field_type) != "radioheader" && $question->field_type != "slider" ) {
if($radioFlag){
echo "</table>";
$radioFlag = false;
}
if( $question->field_type == "text" ) {
echo "<h4>" . $question->field_name . "</h4>";
}
else {
echo "<table class='textSummaryTable'><tr><td style='width: 100%'><label>" . $question->field_name . "</label></td></tr>";
foreach ($resultSet as $answer) {
echo "<tr><td>" . $answer->eval_answer . "</td></tr>";
}
echo "</table>";
}
} else {
if(!$radioFlag){
echo '<table border-size = 0px width=100% class="summaryTable">';
$radioFlag = true;
}
echo "<tr><td style='width: 90%'>" . $question->field_name . "";
echo "</td><td style='width: 10%'>";
$sum = 0;
$count = 0;
foreach ($resultSet as $answer) {
$count++;
$sum += $answer->eval_answer;
}
echo $count == 0 ? "-" : number_format($sum / $count, 2);
echo "</td></tr>";
/*** end here ***/
}
}
if($radioFlag){
echo "</table>";
}
?>
<table class="printOnly">
<tr>
<td colspan="2">
<p> I hereby certify that all information declared in this document are accurate and true. Each item have been discussed with my Immediate Superior and mutually agreed upon.</p>
</td>
</tr>
<tr>
<td>
<p>Prepared by
<?= $modelE->project->manager->family_name . ", " . $modelE->project->manager->first_name ?>
</p>
Date <?= date("Y-m-d"); ?>
</td>
<td>
<p>Conformed by <?= $modelE->evaluatee ?></p>
Date
</td>
</tr>
<tr>
<td colspan="2">
<p>Noted by HR Division</p>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>

how to indent html output using CSS

I am using PHP to loop through an array and return results, each result is being displayed along with some html code. Right now, to achieve the indent I am using a DIV tag and setting the margin like so:
For output 1:
<div style='height: 20px;margin-left: 60px;'>
For output 2:
<div style='height: 20px;margin-left: 110px;'>
The issue with this method of setting the margin for each output is it relies on the criteria to always match but sometimes the criteria doesnt match and the indentation is ruined.
So basically is there another way using CSS or some other way to increase the indent for each output rather than having to specify a fixed one ?
Apologies if I am not being clear enough but hoping you can understand what I am asking, otherwise let me know and I will try clarify some more.
Here is a sample code:
foreach ($data[0] as $data) {
if ($data == a) {
echo "<div style='margin-left: 0px; '><img src='img/server_s.png' style='float: left;'></div>";
} elseif ($data == b) {
echo "<div style='margin-left: 60px;'><img src='img/link.png' style='clear: left;'></div>";
} elseif ($data == c) {
echo "<div style='margin-left: 110px;'><img src='img/link.png' style='clear: left;'></div>";
}
}
You can achieve it through simple list tags of HTML.
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
ul li {
list-style: none;
margin: 15px 0px;
}
span {
border: 1px solid #000;
padding: 5px;
}
</style>
</head>
<body>
<h2>A Nested List</h2>
<ul>
<li><span>Milk</span>
<ul>
<li><span>Tea</span></li>
<ul>
<li><span>Black Tea</span></li>
</ul>
</ul>
</li>
</ul>
</body>
</html>
Reference URL for sample: http://www.w3schools.com/Html/tryit.asp?filename=tryhtml_lists_nested
Thanks & Regards,
Vivek
hope this work for you
$a=0;
foreach ($data[0] as $data) {
if ($data == a) {
echo "<div style='margin-left: ".$a."px; '><img src='img/server_s.png' style='float: left;'></div>";
} elseif ($data == b) {
echo "<div style='margin-left: ".$a."px;'><img src='img/link.png' style='clear: left;'></div>";
} elseif ($data == c) {
echo "<div style='margin-left: ".$a."px;'><img src='img/link.png' style='clear: left;'></div>";
}
$a=$a+60;
}

My sidebar Floating at bottom

In my custom template file, which i made for youtube videos-creating problem with my sidebar, it is showing the sidebar at bottom, below is the code i am using..
Can anyone help me, it should stick at right, as it..
<?php
/**
Template Name: gallery
*/
get_header();
?>
<style>
/* some basic styling */
h1 {font-size:20px; line-height:95%;}
#galvidcontainer {
width:1100px;
margin-left:50px;
height:1250px;
}
.galvidpre {
width:300px;
height:300px;
float:left;
margin:5px;
background-color:#00A0DA;
}
.galvidprevid {
width:300px;
}
.galvidpretext {
width:280px;
padding-top:2px;
margin-top:2px;
}
</style>
<div id="galvidcontainer">
<h1>Videos</h1>
<?php /* Loop the stuff from the videos post type */
$args = array( 'post_type' => 'videos', 'posts_per_page' => 10 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();?>
<div class="galvidpre">
<div class="galvidprevid">
<?php
/* Set variables and create if stament */
$videosite = get_post_meta($post->ID, 'Video Site', single);
$videoid = get_post_meta($post->ID, "Video ID", single);
if ($videosite == vimeo) {
echo '<iframe src="http://player.vimeo.com/video/'.$videoid.'" width="300" height="190" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
} else if ($videosite == youtube) {
echo '<iframe width="300" height="190" src="http://www.youtube.com/embed/'.$videoid.'" frameborder="0" allowfullscreen></iframe>';
} else {
echo 'Please Select Video Site Via the CMS';
}
?>
</div>
<div class="galvidpretext">
<h1><?php the_title() ?></h1>
<p>
<?php /* this is just a limit on characters displayed */
$words = explode(" ",strip_tags(get_the_content()));
$content = implode(" ",array_splice($words,0,20));
echo $content; ?>
</p>
</div>
</div>
<?php endwhile;?>
</div>
<?php get_sidebar() ?>
<?php get_footer() ?>
The thing happening with the sidebar>>http://i.imgur.com/wm82twJ.png
Looks like you have to clear the floats. Use clearfix or clear:both
<div id="container" class="clearfix"></div>
.clearfix:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
.clearfix {
display: inline-block;
}
html[xmlns] .clearfix {
display: block;
}
* html .clearfix {
height: 1%;
}