Explorar el Código

Full API implementation of Faulty profile

Md Mozahidur Rahman hace 1 año
padre
commit
2eaba34d2e

+ 7 - 0
css/theme-styles.css

@@ -1644,6 +1644,13 @@ body.archive aside#secondary{
     outline: 2px solid #ebebeb;
 }
 
+.profile-header-text h2 {
+  margin: 5px 0px 10px!important;
+}
+.profile-header-text .contact-dets {
+  margin-top: 0px !important;
+  margin-right: 10px !important;
+}
 
 .paper-details .paper-tags .tag {
   margin: 2px;

+ 2 - 2
inc/acf-json/group_642aa09ae85e7.json

@@ -113,7 +113,7 @@
                         "id": ""
                     },
                     "default_value": "",
-                    "placeholder": "https:\/\/facebook.com\/rousnay",
+                    "placeholder": "https:\/\/facebook.com\/username",
                     "parent_repeater": "field_642ab4bdc50ce"
                 }
             ]
@@ -203,5 +203,5 @@
     "active": true,
     "description": "",
     "show_in_rest": 0,
-    "modified": 1683188546
+    "modified": 1684836399
 }

+ 1 - 41
inc/acf-json/group_642c30c3d7bd7.json

@@ -26,46 +26,6 @@
             "max_size": "",
             "mime_types": "",
             "preview_size": "medium"
-        },
-        {
-            "key": "field_64536b4fcd2d9",
-            "label": "EmployeeID",
-            "name": "employeeid",
-            "aria-label": "",
-            "type": "text",
-            "instructions": "",
-            "required": 0,
-            "conditional_logic": 0,
-            "wrapper": {
-                "width": "",
-                "class": "",
-                "id": ""
-            },
-            "default_value": "",
-            "maxlength": "",
-            "placeholder": "",
-            "prepend": "",
-            "append": ""
-        },
-        {
-            "key": "field_642c30c3e3387",
-            "label": "Designation",
-            "name": "designation",
-            "aria-label": "",
-            "type": "text",
-            "instructions": "",
-            "required": 0,
-            "conditional_logic": 0,
-            "wrapper": {
-                "width": "",
-                "class": "",
-                "id": ""
-            },
-            "default_value": "",
-            "maxlength": "",
-            "placeholder": "Professor & Director",
-            "prepend": "",
-            "append": ""
         }
     ],
     "location": [
@@ -86,5 +46,5 @@
     "active": true,
     "description": "",
     "show_in_rest": 0,
-    "modified": 1683188574
+    "modified": 1684835879
 }

+ 1 - 8
inc/acf-json/group_64534cae361a7.json

@@ -30,13 +30,6 @@
                 "operator": "==",
                 "value": "acf\/faculty-member"
             }
-        ],
-        [
-            {
-                "param": "post_status",
-                "operator": "==",
-                "value": "publish"
-            }
         ]
     ],
     "menu_order": 0,
@@ -48,5 +41,5 @@
     "active": true,
     "description": "",
     "show_in_rest": 0,
-    "modified": 1684661101
+    "modified": 1684835999
 }

+ 162 - 18
single-faculty.php

@@ -95,26 +95,28 @@ get_header(); ?>
 						</div>
 
 						<div class="profile-header-text">
-							<!-- <h3 class="sub-title">Faculty Profile</h3> -->
+							<!-- <h3 class="sub-title">Faculty profile</h3> -->
 							<h1 class="profile-name">
-								<?php echo get_the_title(); ?>
+								<?php echo $employeeInfo[0]['Title'];
+								echo " " . $employeeInfo[0]['FullName'];
+								?>
 							</h1>
-
 							<h2 class="profile-des">
-								<?php the_field('designation'); ?>
+								<?php echo $employeeInfo[0]['Designation'];
+								echo ", " . $employeeInfo[0]['Office'];
+								?>
 							</h2>
+							<span class="contact-dets"><?php echo "ROOM: " . $employeeInfo[0]['Room']; ?></span>
+							<span class="contact-dets"><?php echo "PABX: " . $employeeInfo[0]['PABX']; ?></span>
+							<br />
 
-							<?php if (have_rows('contact_details')) : ?>
+							<span class="contact-dets"><?php echo $employeeInfo[0]['Phone']; ?></span>
+							<span class="contact-dets"><?php echo $employeeInfo[0]['Email']; ?></span>
 
+							<?php if (have_rows('contact_details')) : ?>
 								<?php while (have_rows('contact_details')) : the_row(); ?>
-
 									<span class="contact-dets"><?php the_sub_field('contact_info'); ?></span>
-									<?php
-									//  $sub_field_3 = get_sub_field('sub_field_3');
-									// do something with $sub_field_3
-									?>
 								<?php endwhile; ?>
-
 							<?php endif; ?>
 
 						</div>
@@ -157,12 +159,83 @@ get_header(); ?>
 						<div class="bio desc-block">
 							<h2 class="m-text">Publication</h2>
 							<p class="m-text">
-								<?php
-								echo '<pre>';
-								print_r($employeeInfo);
-								print_r($employeeJournal);
-								print_r($employeeConference);
-								?>
+							<h3 class="paper-type">Journal Papers</h3>
+
+							<?php
+							foreach ($employeeJournal as $item) {
+								// Access individual elements of each response
+								echo "<div class='paper-details'>";
+								echo "<span class='paper-year'>{$item['Year']}</span>";
+
+								// Iterate over the JournalList array within each item
+								foreach ($item['JournalList'] as $journal) {
+									// Access individual elements of each journal
+									echo "<a href='{$journal['JournalLink']}'>";
+									echo "<h2 class='paper-title'>{$journal['PaperTitle']}</h2>";
+									echo "</a>";
+									echo "<p class='paper-tags'>";
+									$journalKeyword = explode(',', $journal['Keyword']);
+									foreach ($journalKeyword as $keyword) {
+										if ($keyword) {
+											echo "<span class='tag'>{$keyword}</span>";
+										}
+									}
+									echo "</p>";
+									echo "<p class='paper-event'>Publication:  {$journal['JournalTitle']}</p>";
+									echo "<p class='paper-contributors'>";
+									echo "Author List: ";
+									// Iterate over the Author array within each journal
+									foreach ($journal['Author'] as $author) {
+										// Access individual elements of each author
+										$authorName = $author['AuthorName'];
+										// Process or output the values as needed
+										echo " $authorName,";
+									}
+									echo "</p>";
+								}
+								echo "</div>";
+							}
+							?>
+
+							<h3 class="paper-type">Conference Papers</h3>
+
+							<?php
+							foreach ($employeeConference as $item) {
+								// Access individual elements of each response
+								$item_count = "single";
+								if (count($item['ConferenceList']) > 1) {
+									$item_count = "multiple";
+								}
+								echo "<div class='paper-details {$item_count}'>";
+								echo "<span class='paper-year'>{$item['Year']}</span>";
+
+								// Iterate over the JournalList array within each item
+								foreach ($item['ConferenceList'] as $conference) {
+									// Access individual elements of each journal
+									echo "<a href='{$conference['Link']}'>";
+									echo "<h2 class='paper-title'>{$conference['PaperTitle']}</h2>";
+									echo "</a>";
+									echo "<p class='paper-tags'>";
+									$conferenceKeyword = explode(',', $conference['Keyword']);
+									foreach ($conferenceKeyword as $keyword) {
+										if ($keyword) {
+											echo "<span class='tag'>{$keyword}</span>";
+										}
+									}
+									echo "</p>";
+									echo "<p class='paper-event'>Conference:  {$conference['ConferenceName']}</p>";
+									echo "<p class='paper-contributors'>";
+									echo "Author List: ";
+									// Iterate over the Author array within each journal
+									foreach ($conference['Author'] as $author) {
+										// Process or output the values as needed
+										echo " {$author['AuthorName']},";
+									}
+									echo "</p>";
+								}
+								echo "</div>";
+							}
+							?>
 						</div>
 					</div>
 				</div>
@@ -215,7 +288,7 @@ get_header(); ?>
 		max-width: 1200px;
 		font-size: 18px;
 		color: #ffc3c3;
-		margin: 50px 15px !important;
+		/* margin: 50px 15px !important; */
 	}
 
 	.desc-block ul>li {
@@ -591,5 +664,76 @@ get_header(); ?>
 		right: 45px;
 		font-size: 60px;
 	}
+
+	/* added by rousnay */
+	.profile-header-text h2 {
+		margin: 5px 0px 10px !important;
+	}
+
+	.profile-header-text .contact-dets {
+		margin-top: 0px !important;
+		margin-right: 10px !important;
+	}
+
+	h3.paper-type {
+		margin: 40px 0 0;
+		text-decoration: underline;
+		color: antiquewhite;
+		font-family: "DM Serif Text", serif;
+		letter-spacing: 1px;
+		font-size: 1.4em;
+	}
+
+	.paper-details {
+		padding: 30px 0px;
+		border-bottom: 1px solid rgba(51, 51, 51, 0.1764705882);
+	}
+
+	.paper-details .paper-year {
+		font-size: 14px;
+		display: block;
+		color: antiquewhite;
+	}
+
+	.paper-details a {
+		text-decoration: none;
+	}
+
+	.paper-details p {
+		line-height: 1.8em !important;
+	}
+
+	.paper-details .paper-title {
+		font-size: 18px;
+		margin: 10px 0px;
+		font-family: "Open Sans", sans-serif;
+		line-height: 1.7em;
+		letter-spacing: 0.5px;
+		color: antiquewhite;
+	}
+
+	.paper-details .paper-tags {
+		margin: 20px 0px;
+	}
+
+	.paper-details .paper-tags .tag {
+		font-size: 14px;
+		border: 1px solid rgba(17, 124, 247, 0.431372549);
+		padding: 3px 8px;
+		border-radius: 10px;
+	}
+
+	.paper-details p {
+		margin: 5px;
+		font-size: 14px;
+	}
+
+	.paper-details .paper-contributors {
+		/* color: #222222; */
+	}
+
+	.paper-details.multiple .paper-contributors {
+		margin-bottom: 45px;
+	}
 </style>
 <?php get_footer(); ?>

+ 0 - 1
template-parts/blocks/faculty-member/block-faculty-member.php

@@ -29,7 +29,6 @@ if (!empty($login_id)) {
     foreach ($data[0]  as $key => $value) {
         echo "<li> <strong>" . $key . " </strong>: " . $value . "</li>\n";
     }
-    echo '</ul><p>' . $id . '</p> </div>';
 } else {
     echo 'Please insert Login ID of the faculty member</ul></div>';
 }