|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
) Y' f) ]. ]! s. T& |6 T// Theme Option
- \$ x# m2 E( z& L7 O////////////////////////////////////////////////////////////////////////////////
& _4 c1 D+ n* M5 [# Y" Q; I2 ~* Z
2 U* J* i3 H& g7 w% t- }$themename = "Zenx";6 u7 W+ w/ X) T3 D& m
$shortname = str_replace(' ', '_', strtolower($themename));
1 g/ O& {4 K# F6 u D! Z$ p* x% g) v P, G# S3 _( f+ y) k$ J. S
function get_theme_option($option)5 [9 k" t, T5 R V
{# n( o6 X( M. ]% T+ N1 _
global $shortname;
) P, I! {$ x; e2 M9 g! ] return stripslashes(get_option($shortname . '_' . $option));, p# C6 d/ h% {5 j r) q
}) A$ {! p- q8 g
# P+ [- D3 p) s* u2 j1 M' r' ~% i
function get_theme_settings($option)
3 u, ]2 B5 D( E9 c1 l{
5 s9 a: \/ X# H g/ R* d. L return stripslashes(get_option($option));
, u: B, ?1 ~6 s6 _& U}! [( v' A- ^) ^3 z) [1 i
$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");; I2 Y( _1 l+ R7 e
$wp_getcat = array();
) M* c/ ] R. I( V# R7 D1 }foreach ($wp_dropdown_rd_admin as $category_list) {8 `6 E8 {# w0 ]8 A/ x- M; p% A
$wp_getcat[$category_list->term_id] = $category_list->name;
9 H% E' [) [/ S/ `}. L! H: F; V( w6 a6 x9 z
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");$ @7 w) G1 ]3 p7 h8 w% {6 Q
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");; S# ?" X% K" Z) @5 H: q( J3 q
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");1 Y$ E8 r/ J8 T
6 N, u @0 O8 a% o; R- L6 |
$options = array ($ N J2 d" ]! c# l, D
4 P# c8 J2 j% Q" J
5 |! t. C) j& E# d; C6 f
array( "name" => "Blog Header Settings"," J! ]0 u! s( O% u0 g7 U6 X* z* o' L- t$ y
"type" => "heading",
% I" q9 I/ w+ C- g" \* Q" E4 S ),
9 _' n: g$ [( v( `3 o2 M
* q0 r, K& Y! t3 A% b% d# q array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
( x1 J4 l! p' @, O) v v. _ "id" => $shortname."_header_logo_activate",5 \# I! s4 a! e1 @. L! l" Q- o- J
"type" => "select",
/ g' ^5 T o* |. e! ^9 w: W6 t "std" => "No",* F: r9 y7 D( R. u0 [
"options" => array("No", "Yes")),
# S% D7 h7 H4 O7 t- L7 C
- O2 O' R# o) P i; i4 l0 ] array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",: {! F0 n1 Y& Y
"id" => $shortname."_logo_url",
j% R" a J2 k3 V0 L "type" => "text",
# h/ Z2 ]' _2 j# y "box" => "social",
/ v1 A. ]! y/ s# ^! M* ~- l3 b "std" => "",
! j' T/ V& S! z* v7 W' E8 | ),
/ k1 l; b. Y" a( W " a; w& R$ U5 t
array( "name" => "Insert Header Banner HTML Code (Header)
! y% ~* G6 L. f q! G* j <br /><em>*Recommended Size 468 x 60</em>" O" P; Z: w& U4 O: g' d$ W( B
<br /><em>*leave blank if not use</em>",( `9 N- [8 y8 r* ^
"id" => $shortname."_header_banner",$ O2 w" p T8 ~6 F5 s- R$ M
"type" => "textarea",
2 ^& k8 @+ s0 c/ l# Y$ U( `! s% w0 F "std" => "",$ b. T$ U* g& f
),
( @1 T2 h% M3 g, g0 C5 R1 B! F9 S7 r2 P* T2 {# B8 _
array( "name" => "</div></div>",3 {; P. U) p# V9 f4 I F0 u
"type" => "close",
: p; z7 L k" b- E! Q5 Y! ` x0 o9 ]7 D ),! j4 _0 _7 }6 P1 B& U9 } h* W# i
9 K9 W- L7 L% s) e5 \2 w: G- R
) T h* F6 n+ r; A: r/ o. E$ C
array( "name" => "Header Navigation Settings",
& o& C7 j z9 B+ n7 ^: x4 _ "type" => "heading",
. [( D; M1 r6 j" ^9 y ),& A+ l/ F. @' V5 f% s P$ {
/ M6 \5 w* z1 `* s4 Q
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
4 ^, b: `, d! c7 t$ @, K <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
0 e* x7 g( y) `+ X6 W <em>*Enter the page post ID number only</em><br />
1 A* i p0 F0 l3 l <em>*separate by comma</em><br /> O. B" |% T0 K! @' R. C
<em>*Exclude pages which you don't want to show on the header navigation</em>",
3 B' l; y: ^: K5 c- b "id" => $shortname."_header_page_navigation",, P3 \, o$ F; a6 v$ K
"type" => "text",- x, R4 W9 ]6 W5 z* r3 F' b
"std" => "",2 ?. [# m) E/ V% H. R8 Q
),
; X. U2 A; e: ^+ V2 H# l3 Z0 u& x
0 o& R i: h+ F0 D" f% N array( "name" => "</div></div>",) l4 L; k3 R! B; F8 e- r# S
"type" => "close",/ @ \( e8 | m( {
),
& I: r! ^# _9 u 0 R% f; Z( c3 l8 k5 G# y
. N. r& r+ F' d4 w7 T
array( "name" => "Post Auto Thumbnails Settings",
1 r S' C4 d! {9 h% r8 ? "type" => "heading",
( h% o7 S* ~/ _ ),4 q3 B; ~3 B, L, X
" h% O a* J3 m2 l# I% ? array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
) L" k9 z! K. L2 K# C "id" => $shortname."_timthumb_activate",
X6 I3 B2 S. d" z "type" => "select",, P) I2 f @+ G; c: m
"std" => "No",
1 K! X t9 O/ x "options" => array("No", "Yes")),
2 ?: {2 o# G. ~, L) B
: }* T5 l$ m+ [& y( t array( "name" => "If Timthumb is enabled, Please choose its cropping method",
& p& h7 ]- _5 w, u* ^6 J7 O "id" => $shortname."_timthumb_cropping",
1 j1 W1 B. Y/ p7 } "type" => "select"," @! H" R* C0 G% y
"std" => "",
1 r) {6 y# e6 s" s) k9 t "options" => $crop_position),$ I* J8 G, s! |/ Z# J
, z* C( D/ v3 E4 a9 s1 h. R0 S! n array( "name" => "Insert Width Of Thumbnail Image<br />5 S4 l6 t# Q6 t8 \/ m+ _
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
5 y' X& y# @/ \* j- @' [( _" E <em>*Leave Blank To Use Default: 250</em><br />",
9 r* `) N6 `5 B: x6 B "id" => $shortname."_thumb_width",
3 D3 O& t2 d: d: G "type" => "text",% ^. E/ u! @5 r/ \# Y& e
"std" => "",. n2 e9 P, i: W( b+ Q: v9 n
),
: m. D) h* Y2 J8 i, u/ @+ |' V5 K9 r; ]' t* N
array( "name" => "Insert Height Of Thumbnail Image<br />
7 [& T" O/ S8 H. P/ x+ h: l <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
: q) S' S; z* Q U4 ^4 b4 J <em>*Leave Blank To Use Default: 200</em><br />",
3 }6 \' I2 X, I" i" S "id" => $shortname."_thumb_height",
! V$ a; d0 a9 Z" j "type" => "text",& U* A9 F; z8 p1 S% Q
"std" => "",
8 ~: B- k6 R, h5 A7 j ),
. P7 D0 l" `+ z2 u
E! H9 W$ @' T' }# W8 F D- S# [2 P array( "name" => "</div></div>",& `1 w1 M [6 N) N
"type" => "close",0 q7 R2 W) ?- Z
),
( n! G2 @" `7 ]1 }5 C0 E$ O$ C4 \* x$ h; c9 U/ n2 d$ P
array( "name" => "Featured Content Slider Settings",) V6 [3 ?4 Q: G/ H
"type" => "heading",
5 n0 t. G3 N' K1 U( l ),. `: i8 P2 d, o6 S" ], l2 i
0 m# N5 J5 v/ a! }0 ^ array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",( t3 V2 P/ `) D7 W4 ^. b5 E$ ]
"id" => $shortname."_featured_activate",
r0 j2 L! O( S! l9 {/ _ x a "type" => "select",* ^" w; i$ e% v4 l+ d/ s# K
"std" => "No",
( f) b6 e3 S. K6 M "options" => array("No", "Yes")),
- u& z6 t" P5 r0 q
5 P' P- W( v: L/ T0 e9 f L( R2 v+ J# x; m* }0 U
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
( E" r# U. _' V* H* Z "id" => $shortname."_featured_category",
6 G9 D, u5 K3 w3 K "type" => "select",
4 K1 E& g* P' N( X "std" => "Choose a category:",, v6 \5 T/ M0 A0 v$ o+ g+ r
"options" => $wp_getcat),5 |$ m7 ~8 P" D. J& z0 e
) S0 |1 I( E- E/ t9 M
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
% M( y$ I) f) M5 u1 w! T9 _ "id" => $shortname."_featured_number",
. L% N6 R! Y5 S. m "type" => "select",
9 d) f. @$ h+ c( G# V; T' l4 Q "std" => "Number of post:",) W+ p% S: m1 D8 s* F) L
"options" => $number_entries),$ y( m* f6 I5 f3 v
; b$ L; p1 ^( p: h6 _5 P4 Z
array( "name" => "</div></div>",
+ Q4 X- F+ U9 Z2 i; T) Y "type" => "close",
) \) ^0 W/ O4 I% i4 c* _0 Z( t ),
. p7 }; V( t1 k1 n& f1 w9 U" [3 g 2 C* q0 X1 |$ ~' D* R, k
array( "name" => "Featured Category Settings",4 _" s( i+ \6 i e) Y" M& s
"type" => "heading",
" b3 Z- z; n9 h8 H$ I/ y* t2 A ),# [7 L. d! D2 J* U7 P7 t f. { t6 d
& X& u. Q: f2 X7 D, ^ array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
: B+ \3 I5 T) ^: P9 ^, i" ^/ V( E "id" => $shortname."_featured_category_activate",& n4 Y& H& F k6 P6 C- |
"type" => "select",
4 P# i Q/ K, O7 ]% J6 g4 ?# D "std" => "No",5 p0 G* r! E/ G- |0 G8 D4 ?7 B
"options" => array("No", "Yes")),
1 p$ d$ E& _ w# ^& H! R
) U$ g9 J" B6 S+ y5 |& w9 o% p array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",1 e& m) N& l' o f9 x
"id" => $shortname."_featured_category_id1",
/ f& Q y' l# O1 Q "type" => "select",* Q7 Q' {+ f8 H- N* }7 o) A
"std" => "Choose a category:",
& d% t$ \6 f1 T3 M3 }& R "options" => $wp_getcat),
: A$ A+ f* C. Z& _' T/ ? : u0 ^& v1 E) c$ L. q! @+ C
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",2 a; T; w# b6 l J6 Q
"id" => $shortname."_featured_number1",
, d0 `: e E- y% t "type" => "select",
5 a H6 ^" \; x2 f$ B "std" => "Number of post:",
" o9 z/ F; P. {( ~. u "options" => $number_entries),
F5 i0 x8 H2 y i6 h" Y# x: f " f/ Q5 V5 {1 r" c
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",4 m, k2 v9 O/ k: V
"id" => $shortname."_featured_category_id2",
7 v+ v( @4 _# m, E "type" => "select",: U: d( [6 ^ D! @6 N$ N
"std" => "Choose a category:",1 H1 f6 i' n# z! Q
"options" => $wp_getcat),
6 `* ?. g# ^) `. d$ D ' f# e3 ]; f) `: @) C
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
6 s2 L5 }! k) R& u/ ?7 Y$ J "id" => $shortname."_featured_number2",
$ o9 S3 V6 q' z K3 t# w5 K% Z "type" => "select",4 r7 I& g0 f) i0 h" L3 c/ Y
"std" => "Number of post:",
: ^2 d- A8 a% D7 S; f; U/ H "options" => $number_entries)," K u9 M g, @
, p% s7 X# P9 `; o1 S! u$ O
' j6 Z g1 S& R% \8 B1 x+ @
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
# t3 _$ b4 M9 {* @4 L3 X( u "id" => $shortname."_featured_category_id3",
& o6 m' R* m9 b% [ "type" => "select",; _9 ?9 q! T% V# y
"std" => "Choose a category:",
0 f3 ~* K. K" B( B q+ A) e "options" => $wp_getcat),- B2 x/ `; d; ]& Z/ R6 I
/ n3 t6 ]* N n
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
" ?+ R) X1 n7 T/ A7 Y "id" => $shortname."_featured_number3",* C$ c0 }% S. y% o$ q, \
"type" => "select",
8 d/ J5 b5 o, C; u+ D "std" => "Number of post:",
& [( Q" t% P7 y+ s1 z; y- f- Q "options" => $number_entries),8 ^$ ^, U0 @9 n" B" e6 ^$ ]
" [5 j9 V3 m9 A$ t
1 S8 N+ t) u% w4 R% s
array( "name" => "</div></div>",
1 v# \ S; {) ^, r% Y. O8 X "type" => "close",
( H- v& [. m! q2 q ),
# U" ?% d2 }1 C. T$ {2 M, y% b1 n' h, [+ ]% R* P1 T) Y
" O: J+ t: @6 _
array( "name" => "Google Adsense & Analytics Settings",& j& {$ q" l. h S1 L
"type" => "heading",
; k6 o- g: X- P5 s# U" @7 B ),: d/ ]% ]0 l0 i$ n& U
$ v" {+ O6 X7 s" [8 N array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
4 p6 m' M1 [" C6 V "id" => $shortname."_adsense_loop_activate",
9 P2 [9 c+ i; z9 k "type" => "select",4 K4 J* N' I; E- X
"std" => "Disable",- h7 X1 a/ c# _: T: o
"options" => array("Disable", "Enable")),
' _$ {; b0 u" }/ L
5 Z F; S# B! u' \2 i- F6 ~7 e$ s array( "name" => "Insert Google Adsense Code For Loops Here<br />
! Q& h; Z8 [ G) e9 e; e% f <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
9 `5 K1 t& C, ?& C "id" => $shortname."_adsense_loop",/ M0 ^% V+ k, I) N
"type" => "textarea", K/ ?# G4 [, F9 p# ?
"std" => "", r1 ]3 S, @+ T& r: B
),& ~6 s; {1 g1 A; B! \
, J. A( M1 B- I; |. C array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
3 k; b) u" j P w" P7 d "id" => $shortname."_adsense_single_activate",4 Q1 S! A: Z" w6 h
"type" => "select",2 o# G( _% ]5 ~/ ^* Z8 w& Q" g1 |
"std" => "Disable", J* l0 f4 d# Z; J
"options" => array("Disable", "Enable")),) x$ i0 P( E/ g0 p4 n' ]
9 o7 c v! R9 P$ { array( "name" => "Insert Google Adsense Code For Single Page Here<br />
& y' `2 f0 Q' T( J J, Q <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
$ ?; W o7 U {& g "id" => $shortname."_adsense_single",
0 e a: m2 V+ h: v4 u# m "type" => "textarea",& W7 ?- L" f8 c1 W& U8 `* Q2 k% M
"std" => "",' m4 j; h3 N$ ]9 E
),
7 d" X E" S' S5 D
% v; R# X+ J) ^* L2 S; t/ y1 A7 M$ ^! l0 ^! a$ B' H; C1 \" y/ M
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
U8 s% L1 k! v9 G "id" => $shortname."_google_analytics",
4 l; U; F4 S' Q+ I4 k! d. i& e# C "type" => "textarea",
( {3 J) X8 Y: j# v2 p2 ] "std" => "",; C3 a9 N4 y% x. h! Y+ D) R! e" o, e
),1 {6 i4 I4 k+ B+ U1 o
|9 U' o7 L% i
array( "name" => "</div></div>",: L, G+ B1 H/ m% ]- D
"type" => "close",
5 Q6 T' T4 G# Z! C! L6 m8 N% q% T ),
! s- F8 y; ^. j ]" q* u9 c( J) n , ` u' c6 I- e2 a0 }
8 }9 f! W# ]1 F, R0 T' c7 x
array( "name" => "AddThis Social Bookmarking Settings",$ u7 t) _& p4 R* U% E5 [8 F1 [
"type" => "heading",; ?7 l+ o" E! S9 a/ F- L$ _
),1 J$ W# Z5 _* X' D
5 Z8 M' n$ t4 z$ c- j. J# E8 Q9 X
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
# N) Y( f9 I h7 H <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
; S% r( \% G. @7 h "id" => $shortname."_addthis",
1 x6 Q4 O' {4 k8 R "type" => "text",% x" l* E# p0 Q! a1 m
"box" => "social",8 _0 G* A' a z5 g
"std" => "",3 b: v Y2 a. _% A7 P _% O
),
& x2 B2 X1 K' g* O! }- l" o" G; a
/ q* V# R0 T8 ~1 O array( "name" => "</div></div>",
: k/ a5 r2 p8 c8 z& S5 C7 |: a "type" => "close",6 m6 i) ^9 f( I _( w5 s- [
),( N3 L% v1 C8 ?& ]; N; l
- o5 L1 x5 @- F4 O8 k8 b
& `" K+ I2 M, ~5 Y" s4 b& q) Z s. M; x5 P4 r9 R7 E1 Y
array( "name" => "YouTube Video Settings",
, A3 x1 I( P2 e" s# w "type" => "heading",* `1 {- s; _6 U$ g
),
( J8 i0 A% L) b. H3 Z1 R" N; ?$ ^* A3 S% z, S
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
& z" {9 K Y. F; B. j7 P "id" => $shortname."_emvideo_activate",
V4 H% {7 V& |4 L4 N "type" => "select",
) ~" T3 e" {. Z( [1 J "std" => "No",/ z/ |7 v% E' B8 A0 F# ^
"options" => array("No", "Yes")),
' w$ L* j1 ^3 r, L! _5 l4 E* Z2 I! w
array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",3 V6 D4 q! N; r
"id" => $shortname."_emvideo",
B; @# p0 ~. [! p! I' M! h& q "std" => "",
# s. h& t1 a' ~9 ?7 S "type" => "text"), X. l% r8 g6 v
; Q! S; H6 m. a7 X+ [ p
array( "name" => "</div></div>",
5 h/ k( d" Y* s% E2 I "type" => "close",
[( |" u0 d* v) ?- {. A, J ),) q O" ?, J# g8 w' D7 U# h: G
1 e; U0 W+ m+ c5 |0 f' V* i& q
array( "name" => "Twitter Settings",* i2 K; ?/ E9 S. _- Z( D: j
"type" => "heading",
- B' q" r+ `, J* y) S ),
' L; d& v' W; r% l1 K1 f# ]6 S3 Y, ~( p0 L" k; d
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
: T7 v/ x; g4 ?% [" t& h "id" => $shortname."_twitter_activate",
6 `* f3 j5 L# e2 t2 Y$ n "type" => "select",
3 U; b/ M! {+ M9 h' s r "std" => "No",& z0 e- o L5 s0 W* E/ L3 S
"options" => array("No", "Yes")),. ^, r5 o8 O. K: C2 r* {# @& [
% j6 b- b" g5 m# e2 V8 ]' P9 Y array( "name" => "Insert Your Twitter ID here" n/ Z+ Z# C/ G) E7 B
<br /><em>*leave blank if not necessary</em>4 u9 ~1 \ B, Q- f, t8 S8 |- {" K
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",) M1 r3 r5 i& ]
"id" => $shortname."_twitter",6 R; _- R+ Y, X2 o, X1 l0 `) P
"type" => "text",
4 Z% z; V. @# a5 D) J. b "box" => "social",
0 m. ^; e3 |0 ?) P! n& \ "std" => "", I; E: m1 l% [- O) h
),7 Q( [( a% `+ R) L. Z+ P$ t
3 Q' c8 C) s6 V* ?& g0 Q+ Z; m array( "name" => "Enter Twitter Feed Count here7 B f& |' _, G! q$ z
<br /><em>*leave blank if not necessary</em> O! s1 r; t$ [3 e, U6 f6 p
<br /><em>*Enter How Many Twitter Feed To Display</em>",
8 T4 Z: C1 V" ]/ Y6 V "id" => $shortname."_twitter_count",
7 x$ K j' g' W" d$ G8 r. j% W9 _ "type" => "text",$ Q) X( Y% K) ]" R
"box" => "social",
( ^, D7 {/ [ Z3 O# S0 f' M4 e "std" => "",
. S# y- n+ d6 C- o ),
* _$ m' G1 ]) r1 x) j. r! A7 N) x% ]3 p' C/ v
array( "name" => "</div></div>",
. B, K) i/ q6 b; l* E# u5 k+ ?: r/ C+ F "type" => "close",2 M$ G( {7 b4 o/ {. x( k
),
$ E1 n3 j# p, i" c( c5 F L; J t3 j" q$ h2 ?2 b
- W( w2 Y2 `7 q. l
array( "name" => "125 x 125 Banners Advertisement Settings",
, M3 r8 i8 f6 o/ l# s6 W "type" => "heading",* d4 O; L3 X9 L# d5 K$ R) M4 d
)," P' {$ z* y- M0 v
) U9 i$ q. T4 _$ O! ?0 ?& N* O
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",+ `/ a3 Q# r, t
"id" => $shortname."_sponsor_activate",: Q. O& Z4 z) E) |
"type" => "select",* Y$ ]: w5 A) |
"std" => "No",
n1 }- H3 u9 S, \ "options" => array("No", "Yes")),
8 \# |+ P7 n6 B" }- L& O1 f9 D5 T
' R! O3 k. T8 O3 m2 A
6 J, b* l- U4 ^. R+ K/ f array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",9 [. V0 Y$ i5 ?/ h ]
"id" => $shortname."_sponsor_banner_one",) ?- G, g) Q4 z, i2 c1 J4 [! l
"type" => "textarea",/ T, ?5 A) @7 R
"std" => "",
. k+ t: Z* j6 S1 P' z/ ` ),
$ A6 l C" L8 N! B) S
( f6 T2 d, b7 ^9 p6 N+ k array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",. D. v; q7 G p: Z1 H( M1 D7 e, k
"id" => $shortname."_sponsor_banner_two",
2 H! T8 y/ M' Y! d8 u/ K- w "type" => "textarea",- @ S+ ~; z7 v- R7 [
"std" => "",
! {0 j$ W* M. ~9 ?$ C ),, x& k) W1 S+ A& |+ K2 C
) |5 d, _- ], d @ ?6 o
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",1 N* g' I& m5 \2 s
"id" => $shortname."_sponsor_banner_three",
6 I% }5 F/ P# O Q# l4 Q "type" => "textarea",' {7 t- ]2 W9 v) }7 o+ A$ M; q; H
"std" => "",
; G5 K+ }3 l' f; I ),
8 ~; y% e" _' ]8 A( E; Z0 |
- o7 |/ A0 _; K" m! \0 T array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
. C! P( A) m# M5 l "id" => $shortname."_sponsor_banner_four",
) n: K: E7 a& M "type" => "textarea",2 K p" I! P ~
"std" => "",7 d& @1 A# j6 g3 \$ {$ X
),4 b2 [- I) Y ?
9 k3 j! p& H) ]9 D$ y! w array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",: v0 G$ j; W' D7 e; l4 h; l& Y+ C
"id" => $shortname."_sponsor_banner_five",; [1 h b% ]4 m! @. r
"type" => "textarea",
& j7 `6 |8 V. }, J "std" => "",# Z2 [; O0 @' B, @' [9 G( v7 F( Z+ Y
),
/ B( J( n0 \9 |) _
2 x1 r% d- K/ x- _* k4 @ array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
& s) ^# {$ q2 L8 M4 X% X "id" => $shortname."_sponsor_banner_six",
2 }5 Y6 J+ M& Y9 I9 o8 ^ "type" => "textarea",
' |' {7 i) r- v, Z9 f2 R "std" => "",
K. t& A1 E$ C5 f5 M1 I ),
9 t" D% v* X6 ]$ U3 b
% i" z5 e% f; g array( "name" => "</div></div>",
4 v1 f: T8 Q& R/ W# Q; n "type" => "close",
" J+ l5 t, Z @8 M' l ),4 G# ?! U `% n, p
2 {4 y1 v' ?, a2 r) l7 ]& t
; R. K1 r' c& G( \, O5 J9 z8 [4 U1 L7 |$ m% L
);( _- `5 ?+ N7 a$ l
1 e: k. a9 P7 j1 k$ t, }( H4 c
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
# r6 b# }! L+ U9 r1 c4 u* O: ?/ U% K7 V& |: ?
echo "<div id=\"admin-options\"> ";1 X! Y. F6 T' J8 n! m" J7 l
: | n0 t- a. }1 t
global $themename, $shortname, $options;4 a2 n0 g% \6 {" ~& D
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
' V# y$ B9 K( \1 v d% f" {4 N( eif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
. T: \* I2 h$ a3 @. P7 {+ a?>7 t' _' _( w0 y: G- o
* D7 }2 n3 U `+ r( T0 P
<h4><?php echo "$themename"; ?> Theme Options</h4>" f, E$ V0 O5 a, ^. G$ @
1 R1 m+ i' k/ Y! A0 H, ~<div class="annouce">
2 f. i" t8 _& y* K% b& Y- G<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>1 P9 l& w: o2 j3 B
<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>6 o' d. j! `* Q5 b7 A; g t0 N
</div>8 N& G$ A7 ^5 q% A6 p' d+ Q
" D+ s! ~7 @3 I<form action="" method="post">
5 h+ z: b; c- c: g$ [5 E- h0 b% Z1 r5 W$ F& E9 j' B' U
<?php foreach ($options as $value) { ?>4 `5 M6 W7 I8 y$ B( G
; V! V5 f" Q- ]# x- n<?php switch ( $value['type'] ) { case 'heading': ?>
3 p# Z: s8 \+ x- ~) H% N! w% v v3 F( @- X j& T
<div class="get-option">
$ _! g3 a& f' H1 J9 L
3 e& Y' F) F; L) A! W. E<h2><?php echo $value['name']; ?></h2>4 m7 c8 p3 s: \! P9 k4 d2 n
0 Q) k( V4 ~" G1 U, R" u<div class="option-save">
# y* {, @. T( C. }+ O* R4 i) v0 j, P. b; v; n+ W- x
<?php
# {6 C7 X0 T0 \/ s3 r; ~6 V6 qbreak;. k1 ^" |6 A& O- M
case 'text':
& l$ `6 K4 Y7 h?>3 R% S7 J$ e7 L1 O; g0 H5 Z) B2 g. ?
: v6 h6 ]0 z( r; A: W8 I/ d
<div class="description"><?php echo $value['name']; ?></div>
. `9 @: n) T/ I* [/ }<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (7 j* F3 `4 J6 ?
; q0 v" f! Z6 O; e4 ?get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
) U' o& C, U: j3 {. ]' \: {3 f1 P5 G7 B* r4 R
<?php
9 C$ @9 r5 y [8 y# qbreak;0 F4 l% W6 U5 C' L9 Q, U
case 'select':
: U4 {: w7 k" Y9 z0 w/ K, y?>8 v# V# m( t: w% @. {
6 ]/ v( s, j5 j<div class="description"><?php echo $value['name']; ?></div>
' q9 \# J; e0 C c" R8 u0 O( \1 |<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">. a/ p( _2 i' U2 E
<?php foreach ($value['options'] as $option) { ?>* Y) g' `! ~! ~
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>, B, | `4 j9 {9 z( n
<?php } ?>
& T+ F* ]) m9 Z5 S9 ?( _. V</select>
+ L' I. e; {1 W! {</p>
4 x: ?# G+ N7 c
' V+ ]; `+ a6 y9 R% j<?php7 S( T( d% ]& l0 w, Y7 w$ J8 R
break;- t' @+ V& r7 R0 g( D, f1 w, G
case 'textarea':
P3 S+ B9 C1 S$valuex = $value['id'];7 A8 y+ X4 l: g- Q# f5 H- D
$valuey = stripslashes($valuex);
$ m0 \) k+ b; g$video_code = get_settings($valuey);
6 n+ N- z8 x9 v5 }1 U6 ~; [?>5 Z% J+ F8 W. u" ?- M' s+ H
: c4 x- r) @: k8 O
<div class="description"><?php echo $value['name']; ?></div>
3 E( b" G0 o1 U9 M$ X @<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }0 x, Q% d. b4 H `0 i
6 K% ] _, V: B0 ]; j
else { echo $value['std']; } ?></textarea></p>
+ I* E9 c" m* G) M$ \5 g% n! f9 h- Z! T7 L( b0 H
<?php
% \7 m b9 Z- ^2 s1 y% }. Jbreak;
. z; b( N' x4 j. f" c! ocase 'close':8 x v9 v- @" w$ I
?>
* q, i$ p# [% y
2 U% S: Q8 y/ {: e<div class="clearfix"></div>
! u, ]: W: l: D' f</div><!-- OPTION SAVE END -->4 P N8 j$ \% P. X7 Y
6 z, P- @4 }8 E- P! M5 d& w<div class="clearfix"></div>
: w T. E9 X2 i, g3 g5 I</div><!-- GET OPTION END -->
& C; E0 r/ q% R" C9 D6 w! ]$ D
3 K' x6 S/ V) I$ ^( x<?php
4 {3 ^* B) [ U3 @% }break;; V9 ^. m' t' l3 }# c [- {1 P7 K9 O
default;. @; L1 ?+ n6 {3 I$ j8 y
?>% ]! M! L& |, T- X e
& `5 g$ [$ L9 R: n) v0 }( o0 \6 ~- W1 w; k
<?php
5 `3 F* J, T6 G. Z$ I: zbreak; } ?>
; w4 n, \5 M. j" p7 D- \' ]
) x4 Z2 f( X, f1 ^! D<?php } ?>
- B" K+ n3 U! N; x2 I# k: w1 x( U6 U1 ~* d/ O
<p class="save-p">. Y: G4 V/ u) x3 \5 h* K: _% q, Q
<input name="save" type="submit" class="sbutton" value="Save Options" />
/ ]2 v* |3 c$ t7 D! ?; }/ ?<input type="hidden" name="action" value="save" />
7 W E6 g7 d5 d( E$ ]- F6 ?/ A. }</p>
( e/ {( {* X$ W* L$ {; ], p</form>
' X9 q" L% S$ d6 W
' X/ E7 Q# }" f' W; W" f7 P4 m<form method="post">
: |' O1 U; o4 z<p class="save-p">
2 H/ o) a- @2 @& V0 Q% W<input name="reset" type="submit" class="sbutton" value="Reset Options" />
# v# A2 V" u1 A9 }+ }/ O4 c<input type="hidden" name="action" value="reset" />4 {& o9 O# [* l$ F) Z0 c2 m
</p>& j3 ~; ]' p! }1 Z L! K$ }5 L
</form>( ]' _$ c% Q$ G
* L. @" }; U, L3 \' i2 Y) W- K</div><!-- ADMIN OPTIONS END -->
" p: z3 K% K, Z: Y) w y' k% d! S
: g% w5 _7 N+ ~, [' a6 X<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }. R% d0 H; W& ]+ R& ?
- A* D" Q2 F' s4 L# k! \function mytheme_admin_register() {# M2 V) P7 I: {+ f: H
global $themename, $shortname, $options;2 z5 j, P( d: r9 l
if ( $_GET['page'] == basename(__FILE__) ) {( [' L G8 g( n
if ( 'save' == $_REQUEST['action'] ) {; g) }! y3 y* @, y0 G
foreach ($options as $value) {) N. ]# W J. k: V
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }$ ^( j4 n( c# B$ V( I
foreach ($options as $value) {
. W4 }9 X/ u& G' I. ^8 {4 E1 K1 L! {1 ]if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } } V6 F- F" e/ F# H5 f8 n
header("Location: themes.php?page=functions.php&saved=true");% J& _! O% y2 I& }- `1 r
die;
1 Q4 T# h, i/ C7 W) n4 {" n3 r} else if( 'reset' == $_REQUEST['action'] ) {
4 O8 [0 R) w$ T7 r7 }, u+ i( Cforeach ($options as $value) {$ n( P% d0 f- d# X$ c: V0 ? Q5 J
delete_option( $value['id'] ); }6 L! N# @ C2 k/ R3 `4 {
header("Location: themes.php?page=functions.php&reset=true");: k! P, c, p; s. t) M9 l- H* ~
die;0 e2 ]& k+ R! t& T& B
}' C" P) ?0 b9 Z3 f7 b- i0 s
}
9 Z' b! Q2 j6 m+ m! N" \ h$ [add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel'); q8 ^" G- W0 q& I2 n; i" @
}
9 X8 u0 \1 {$ y
' B( o- H' e0 A$ qfunction mytheme_admin_head() { ?>
! c$ e4 ]. j5 u- T! ]! I+ b5 V9 \<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />2 c3 U$ |9 M8 j$ V1 n: M. _, l
<?php }
: a$ C9 m) i& v7 U8 L6 g% ] |
|