|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////+ ], g g% u8 I# k; |7 w
// Theme Option
3 L1 v) S8 f8 Q! h* k* C4 p( V8 a////////////////////////////////////////////////////////////////////////////////% W5 P4 \3 d7 L, f8 D
7 `( G( v& u7 X F: K* J# B8 t
$themename = "Zenx";
' X1 f$ z! U% `6 \# ~0 L$shortname = str_replace(' ', '_', strtolower($themename));4 ?; o. I% j1 J. }! s
" K# Y/ E4 P5 x; `0 `/ bfunction get_theme_option($option)) b( x) s: L2 v2 V4 x* n
{
- }* o- n7 R! `6 k$ g5 p6 w J global $shortname;
7 N& ]7 X4 W, V7 a+ }: X0 z return stripslashes(get_option($shortname . '_' . $option));6 }7 i/ }6 c1 q8 `* c2 ^
}1 x" ?. U: T. c/ s" U! \- k+ s* y
3 l5 u) @& _; v5 }function get_theme_settings($option)
( P |( g& r$ s9 i{3 p! [1 L- n, j* L* g
return stripslashes(get_option($option));
9 j2 [9 e7 } x: S}
% [. c- b! A1 m4 |+ S5 R4 q$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");! D- Z+ J1 V* ~- ~
$wp_getcat = array();
2 ]9 \/ ^7 q. y3 }foreach ($wp_dropdown_rd_admin as $category_list) { ?. g7 y" S' k3 y
$wp_getcat[$category_list->term_id] = $category_list->name;; k# _4 m8 G" c3 x
}$ q! Q( d0 {, b1 t9 F
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
N2 J$ A, i5 |6 r" L$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");7 G& H. d/ T9 B. X7 F: L2 @
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
) Z. p" i/ }1 T7 w- M" r( \& g; @8 G0 g9 I K3 t; X
$options = array (( Z- y+ q7 i! h/ i$ X
0 R' k$ u/ b+ c: |
! ~9 o; z, v0 k1 B/ J array( "name" => "Blog Header Settings",
2 |- O. M0 U8 Y& j9 p) g3 F "type" => "heading",: c& j/ E4 [2 n" O4 O- [/ k# }
),; Q- b4 V, O: C% {
' o( ?, O, V) ^ array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",0 ]( ?( N" f- b; o
"id" => $shortname."_header_logo_activate",
* w+ I& J# p1 C% b3 ?& v# |9 K "type" => "select",4 E" ?+ P$ m+ h9 r, H/ u
"std" => "No",
% D' E9 f% k3 c3 J+ M8 O! [5 }: y "options" => array("No", "Yes")),
0 _2 B& P A" U7 {5 w+ q; q' |7 d
% x. Z9 A! \/ Z0 R/ Z/ K4 ~ array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
% D8 P m, {- D2 a8 F "id" => $shortname."_logo_url",
5 c+ m! j4 | Q+ ?% G "type" => "text",9 B& V0 y0 ~5 @) I' H
"box" => "social",
; F9 m1 {3 E; I3 P# m& h "std" => "",; u% ~9 _+ e$ |1 F4 ?* @
),
# Y6 ]6 E" T/ E) K
! V/ O! I" {1 ]7 e; { array( "name" => "Insert Header Banner HTML Code (Header)7 Y4 y# ~) ^ I8 ^9 |* }; F5 H
<br /><em>*Recommended Size 468 x 60</em> Y- J; {: g& o6 ^1 ^* r/ x) {
<br /><em>*leave blank if not use</em>",# g& U( Y9 P8 k) k9 f. `
"id" => $shortname."_header_banner",
) ^5 M9 u7 W: Z5 M "type" => "textarea",
( O! d6 {& R# p! i5 A9 j: ^5 | "std" => "",
" K, k8 _7 \' T3 G( K ),9 e2 u$ ]/ ^' X0 J7 k: h9 ]$ c
6 O! ^ C6 V" r/ J5 j, U/ h
array( "name" => "</div></div>",$ C- p3 \1 a3 h4 ~/ m! x, a
"type" => "close",6 K( M0 b w( E
), Y0 t& B3 b# w: c4 ^! N7 ?& }: {4 @
* J$ X7 t$ V1 n
% Q- D( S% U& G3 `' T7 r array( "name" => "Header Navigation Settings",
$ T7 }( B2 b6 }3 ^8 \- j; u" p "type" => "heading",
3 Q* V% ], T2 A+ j3 y$ B ),( H% m9 j# N( N; \- `
2 B3 N" h* e6 O- y$ A0 M
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />; N9 i. j* O; Z/ Z
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
* g1 I& Y% O8 G$ }0 r- ~ <em>*Enter the page post ID number only</em><br />
+ M: Q+ J- a9 I5 G7 A4 _ <em>*separate by comma</em><br />) D+ W/ k7 d# f" m
<em>*Exclude pages which you don't want to show on the header navigation</em>",
" ^6 e1 H3 }2 z5 h5 U8 ?. Q/ k "id" => $shortname."_header_page_navigation",- p0 }1 r7 }: ]$ [
"type" => "text",
2 s2 U' R7 t; A3 k% l "std" => "",3 ^* K/ z2 C' C) l1 F4 p
),4 s: ]* s8 G0 J0 X- k
' a$ l' B+ v& G* m! i7 w, g
array( "name" => "</div></div>",
& Q& g; q' {; N: N3 V! I6 e "type" => "close",
3 @% u& g% C1 r3 ` ),! f& u- L% }: W# }9 K2 b
* M8 l" f6 U* C9 @, m8 \6 r
) R l# J1 }' p! {) j array( "name" => "Post Auto Thumbnails Settings",
1 A2 H" o+ \9 R; P "type" => "heading",5 d. f( Y% R4 r& b3 \' \4 Z# U" d" u. Y
),, h0 L& K/ b% q1 g7 p0 i& q& h+ v/ `
1 x2 S5 K- L& ~2 C# U: b
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",* U7 y: i* Y& K6 X! B
"id" => $shortname."_timthumb_activate",- D! ~/ V B! C g. n& B7 X; U. b: S
"type" => "select",9 O8 S7 f/ g' x a7 t# [( D
"std" => "No",1 m0 o% S' ]0 P7 S
"options" => array("No", "Yes")),/ M9 q4 q6 u" d- T% ^& b3 t. v
' V7 i, H8 ^( k7 x
array( "name" => "If Timthumb is enabled, Please choose its cropping method",/ }# K* K8 p, e* P! W( J N5 B
"id" => $shortname."_timthumb_cropping",
' ~& g) B0 M/ V, @# n1 c1 L "type" => "select",2 ?. V1 Q8 k2 }3 |, H
"std" => "",2 M' Q$ u: n+ W4 L
"options" => $crop_position),. K1 f! L# T1 H7 K4 q- r
9 `' J, A9 d# g- J3 T
array( "name" => "Insert Width Of Thumbnail Image<br />3 @ n: `, P/ \$ c& \0 ?/ @* W
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />/ s! |+ v+ |; x4 U
<em>*Leave Blank To Use Default: 250</em><br />",0 ^: e8 y6 K( r
"id" => $shortname."_thumb_width"," U% e: X- ]' a0 q: K8 a
"type" => "text",
" T& M. e; m& C }" ]0 ]0 E5 T "std" => "",5 p1 f8 L H: V" O
),% U. E5 S' }! z: F" r0 \% P
, M) Z0 z( R/ ]% Z2 p4 C5 S$ r u array( "name" => "Insert Height Of Thumbnail Image<br />
& o/ l# {# h6 p0 e+ h, a# k <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
" J1 l- d. q% w+ J# S# g3 j( B <em>*Leave Blank To Use Default: 200</em><br />",
1 v8 f& A0 m; R) a( f9 ^ "id" => $shortname."_thumb_height",
4 `; H0 ^( l, \3 o "type" => "text",2 q: T- {& U" d/ i8 t* Z
"std" => "",$ l9 Q% I8 i# f9 j- H; I7 R
),
+ q7 `' E* }1 O5 Q R7 z2 D2 p) Q8 r/ l! p4 }: ~& ?0 V
array( "name" => "</div></div>",: T' t) }* F2 `2 P5 o) R0 R
"type" => "close",4 a# `9 n0 e% A0 P) a5 R; x2 T+ g
),
, |; v9 g+ \+ F6 M" U7 r l$ V' M
: Z9 b& h, K2 R. M array( "name" => "Featured Content Slider Settings",
1 r' o- G" o1 U. K. O "type" => "heading",7 P" v2 ?5 P A1 f( J
),: E! I3 J& d0 t$ w" ~: F
$ `& o, u2 b r" V( B+ n' u
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
" ~. y3 |2 o) V, S6 P "id" => $shortname."_featured_activate",4 W( U3 l9 T2 g% M3 U+ d
"type" => "select",
+ [( j/ t4 R- H3 E/ L "std" => "No",! z4 K' K" Q% l
"options" => array("No", "Yes")),7 h3 y( U! I- x {3 }5 D
- A5 Y% f" L7 m& Z0 |: F- n; _$ x X6 K7 d* C# z L# {
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
5 T1 o$ K, L. p0 K0 j$ j. S# } "id" => $shortname."_featured_category",
' v/ b5 L1 M+ a# C. d' s. {& f "type" => "select",4 k+ }3 z, Q5 T. ~: R6 G u; W9 e
"std" => "Choose a category:",% G, s! e( m! E% n; i" Z
"options" => $wp_getcat),
. s) M! m) f8 ^+ A
% T% Q5 n0 P1 y4 ^3 _3 m0 q array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?", B+ w7 A' I; d) C8 g# J# p+ b* c
"id" => $shortname."_featured_number",
; D$ ?+ Q) o7 R( X5 d "type" => "select",, b1 V; D, u5 z! f. J' m
"std" => "Number of post:",* w5 |5 h" C) z: l* J% B
"options" => $number_entries),
4 f8 p' y9 `2 Z% I# p- V& Y4 \& o, E# I
array( "name" => "</div></div>",# l) R4 ]% ^: ^/ R2 S& r. D
"type" => "close",
6 R) }' Q" n( J) i' f; l' m G ),
$ o, b! x4 [# r. j! [+ K
g- u0 H5 o# S array( "name" => "Featured Category Settings",$ v ?* w: j1 N
"type" => "heading",
8 z' H/ v- [9 X ),: _. F5 e% g# T1 R: o% F
( J9 b4 x8 X. Q& k6 i array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",- |! v) c4 z% D5 |* R% T
"id" => $shortname."_featured_category_activate",3 }( k8 v" B/ T0 V$ ]* z' r
"type" => "select",
4 S& K$ x* Y$ d "std" => "No",1 r6 Z1 a, Z3 {! ^
"options" => array("No", "Yes")),5 H- a" p% H. e. ]1 u8 F$ b, y: h' }
- L6 G1 }! ^7 G7 a array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
2 L, J5 ^5 G1 ?5 [/ ~0 s$ K/ B, r; u "id" => $shortname."_featured_category_id1",# N7 m1 l9 ^9 Y+ E! L( }; o# A
"type" => "select",. J- H0 Z0 X" k3 H
"std" => "Choose a category:",
3 w1 b9 f, i% H "options" => $wp_getcat),& L! r" A8 B/ a& C% f
; I! @7 C6 U4 V array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
5 m! f, R) |. X2 ?* r+ x "id" => $shortname."_featured_number1",1 _4 f- j0 m7 R' M! H. \
"type" => "select",: }; K: u' w G: O9 Q
"std" => "Number of post:",
5 p& v2 M, A- c$ z- k2 f; f "options" => $number_entries),# H6 H& `3 q) Q2 s+ C! R2 x6 F
1 `" F: m# o M: a7 N$ a
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
- M$ i1 s' `% `- z "id" => $shortname."_featured_category_id2",
) q [, Y" A: f2 P/ D "type" => "select",
% a4 S3 S2 r1 [/ W "std" => "Choose a category:",
/ p5 v7 f, C' _$ l1 C# Y "options" => $wp_getcat),
; m( X2 P# r" ^. c; M3 J4 g( U2 ` : w' ^7 e% V8 @0 M
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
2 M5 d) n0 F7 Z1 u, x7 U "id" => $shortname."_featured_number2"," I. j' b4 o \3 w4 y
"type" => "select",
; s) T" ^5 B* u& S3 c1 H0 l; R "std" => "Number of post:",( E& b, E' k5 Q, L6 j1 u
"options" => $number_entries),% B( @9 e2 f5 m' T$ r1 m }$ P
7 Q1 Y; E0 x$ P( K m- S1 F & U+ T- @ w$ F$ W# H
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
3 g2 m4 N, P8 y! E/ p: X$ F6 X5 | "id" => $shortname."_featured_category_id3",/ @& h2 ~+ l0 ^7 ?. a; z
"type" => "select",
+ O& P4 A/ v" E9 q6 U: n5 S "std" => "Choose a category:",
( L# ]2 x, E8 n x! p "options" => $wp_getcat),: [$ r+ l, G8 L r9 P: `
5 v, B6 K6 P% l; E. ~
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
8 K% n2 T8 g2 i2 X/ k3 G. o "id" => $shortname."_featured_number3",, u3 z8 Y# ]- [8 P% M
"type" => "select",/ y! z% @+ u6 j3 L% E# x
"std" => "Number of post:",3 r$ I; T: t/ ^
"options" => $number_entries),4 N. @3 H/ d4 o$ E7 T% O' V' j
; w& P/ j9 A* y9 l. s
+ U1 m- t: G# R \ array( "name" => "</div></div>",( T' ?$ y& @1 e" j$ j
"type" => "close",$ C' ]" w! x8 U/ k: `2 ?
),/ |0 i+ D7 }6 Q, E9 Q7 O( _
- Z$ ?: g/ Z+ K
9 T, ^6 r* Q- o. Y3 _( D
array( "name" => "Google Adsense & Analytics Settings",: \! d) z4 X8 T: ]4 b9 r' z& A
"type" => "heading",
( C8 |8 y, B ~1 n4 N, k% M ),* m- M# ?$ j4 v" X
; \( d$ s. [$ P I% l
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>", M- V$ @! o+ L) V' A; }& [
"id" => $shortname."_adsense_loop_activate",# h0 ]& x! g: O% @
"type" => "select",, b4 W3 b& G* w" [5 R: z
"std" => "Disable",! K9 v3 U; k9 M8 X5 a' V# W5 y
"options" => array("Disable", "Enable")),- W" p, D( i! f1 u* h) S4 i
* [) s2 k! T# P$ Y
array( "name" => "Insert Google Adsense Code For Loops Here<br />5 V) w6 `# [1 I' M9 `
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",; n2 o( Q0 {, P0 M* Y1 I5 O
"id" => $shortname."_adsense_loop",0 T1 |, W. s/ B# e. d1 X8 F
"type" => "textarea",
- B6 Q3 Y6 X$ |. C "std" => "", c/ `* z! F$ G: U; v5 P8 C/ s
),6 n, f2 C2 B' X- G: G
( M" `5 O4 P8 B Y) W; R array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
4 k) [5 N) I5 d "id" => $shortname."_adsense_single_activate",
/ K( K1 o \3 Q2 `2 V "type" => "select",
, E) ^" p) k# n$ o "std" => "Disable",
- o3 L# m% w2 M- F6 O) ~/ c$ y4 s- ~ "options" => array("Disable", "Enable")),
2 e; c+ I3 n6 H8 r/ g' `# b' @8 Y
6 _3 p! P. L9 b$ Q( R: O array( "name" => "Insert Google Adsense Code For Single Page Here<br />
) F) M3 b8 W) d0 z7 E( @$ I <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
) L( J/ E+ F# i "id" => $shortname."_adsense_single",
/ i9 g% s: `7 n- B u "type" => "textarea",9 W) u" I/ x! p9 U; p. v8 i
"std" => "",. i# g& [4 B- w# [
),
3 `4 F) P f) Q" l, g: U
, X* t5 M1 o" u3 f
/ V, j+ Z" U$ t array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",& H b) X" n2 r4 G* e; A, L
"id" => $shortname."_google_analytics",$ N) z- g# d$ t6 J$ U# i/ ]
"type" => "textarea",- K! i2 V3 L; |7 \
"std" => "",! q6 _2 k) r% Z! {
),
7 K' g+ ~3 j) p4 z4 Q% X- A1 ]4 O+ L0 E4 @
array( "name" => "</div></div>",
7 l/ k2 m- p7 G "type" => "close",5 C P3 K- Z% T1 M; m
),
5 b- ]0 u4 i8 {* S" d
$ i V: E2 w5 |! @) ^: p) O! i4 S! H / r- t( h, v3 q( i3 P
array( "name" => "AddThis Social Bookmarking Settings",3 ~- j/ S! }- x2 }: A9 U
"type" => "heading",
& B5 X4 K4 c- |) L3 S) D. h1 y ),7 @' O; T3 r$ S# E: c
* R3 J. | p* `3 I/ } array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>+ O& M& N9 R) m
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>", Y# Y0 W. R2 b( G$ S
"id" => $shortname."_addthis",
& y8 x9 D y+ ~4 |$ @" O- _ "type" => "text",
0 D! a% y% D7 J/ g2 Y! D) v "box" => "social",
3 D# p2 o7 @3 W% q% ? "std" => "",
, I# X/ X7 W# k* N" V6 G ),
8 Y% Y: g4 j! R/ }) v. X2 o
( _5 \! C0 ^ H0 o7 `! @+ } array( "name" => "</div></div>",, |- W; J e; s# }/ Q
"type" => "close",& t3 F8 j1 i. j
),
8 E; p7 Z% W% t, `; K+ {
! ^+ u9 P2 m4 U: M% ~: ?7 N / |! m3 O4 ?: e; }1 x
: ^/ ~0 ?7 j2 D/ f2 ] array( "name" => "YouTube Video Settings",& Q9 l1 k( u0 J& n( ~
"type" => "heading",; x+ u$ O3 ^/ w2 q
),. l9 ~) w1 V9 B1 I1 D, ]# c, Q! |
+ q" |1 k* Z2 _" ~ array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
+ H% K# }) B, Z! i0 j0 p( \. s; j9 } "id" => $shortname."_emvideo_activate",
4 }6 {1 j% q* l "type" => "select",( w% I* U- j! q" E
"std" => "No",
4 e3 ^2 I: Y; x- a! b "options" => array("No", "Yes")),
# `* b# o2 e' l! M0 U
4 j" u0 r8 z1 i( g! n2 {( M1 u 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>",5 A: j L0 I+ j- L/ q5 x
"id" => $shortname."_emvideo",, X6 a% w4 m, s* [" i% i0 ?
"std" => "",5 y5 f9 C% X* ~; m2 _! t8 Z
"type" => "text"),6 k2 D4 ^/ j3 T @; K
5 a d! a" s" s! `% } array( "name" => "</div></div>",+ b% d% y- V4 E1 f
"type" => "close",2 q7 X C# ~& \) @1 ]( Y8 v
),5 m# Q6 ?4 A; u" x8 o" W7 s6 A
& [, M" r9 d. H0 B% k l array( "name" => "Twitter Settings",, k( q& k% F6 ~: G1 e/ I
"type" => "heading",, _0 A$ W9 K3 W6 z
),
9 m% k8 z9 q6 A, X
; E i8 y: `2 X2 e' A. \ array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",1 S$ A4 U! @1 ^. s/ d# P
"id" => $shortname."_twitter_activate",
" r9 ] j5 Q; n' W6 ]0 L2 b: \ "type" => "select",) j5 u9 W. \: s1 O; T
"std" => "No",
~" q' W1 X6 O: [# ~' w) \8 ]6 [ "options" => array("No", "Yes")),
* e6 r% F4 [* e8 ]2 E: w9 `
& z5 r* E0 r. o* D6 C array( "name" => "Insert Your Twitter ID here
) L- e3 Z) M- V8 v( P) |/ ? <br /><em>*leave blank if not necessary</em>0 v* K i$ Y6 |! A7 ~/ l3 B
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",$ H% X# ]2 f1 G7 m! [% m
"id" => $shortname."_twitter",
6 `2 F2 _4 P1 ]& X* A7 e& L "type" => "text",
, C9 B0 Q$ O" {& p "box" => "social",
/ r( S4 I4 Q" I" K! K "std" => "",1 A1 u J) z1 X* s* `9 n' D$ b' ^, G
),% p* Z/ A. ]' P) f- d" C
" \! U% n. C. s" K
array( "name" => "Enter Twitter Feed Count here
" @9 ^! X' A h4 |" S <br /><em>*leave blank if not necessary</em>
2 x- _$ ^5 }7 M) ~1 M& a <br /><em>*Enter How Many Twitter Feed To Display</em>",
, l0 X7 F4 c4 A* X7 m, k. g6 b "id" => $shortname."_twitter_count",* b+ W% R2 e7 v$ P! [1 `
"type" => "text",) y4 S* K+ C- S0 n. d: R
"box" => "social",) b/ c4 K% @9 r7 v+ T, N( c5 x
"std" => "",
! z1 P' x: U7 G; K5 M6 {$ o ),
0 w. _& W( c5 S- I+ x- Z/ N/ B
/ N4 E" W: a( C) { array( "name" => "</div></div>",& Y, h' V- B! k! V: U$ R$ I V
"type" => "close",
/ P' K1 D! b9 d! ~ ),
: Z A' q# ^, F `3 I0 M - p" m% x n2 e% p8 ^' Y% R( U- v
5 P9 Z3 q! S; o {+ R% s
array( "name" => "125 x 125 Banners Advertisement Settings",% Y4 y Z2 V, C& E- y
"type" => "heading",1 w+ k3 f7 N3 y9 Z8 r
),' A( L7 t1 m% Q& q
+ p3 ^0 e9 h0 u. ^5 t
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
2 k4 v2 X! l. W% m6 L# r! ~) [7 G "id" => $shortname."_sponsor_activate",
9 o' s# Z" o3 ?9 b. j5 l$ n "type" => "select",; S6 ?! Z1 D8 }4 T* |# g
"std" => "No",1 ]6 z1 T" i- d4 ~5 C) X
"options" => array("No", "Yes")),
4 }( i2 i5 j( ^- ~' N+ W- `
! N" r. l3 _ z- m( H0 A3 j! ]0 A# U! E
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
; w% f# ?1 u. F3 Q% y) z' I3 Q "id" => $shortname."_sponsor_banner_one",
: J. I7 z9 e& \' @8 d# b8 O "type" => "textarea",8 t& X# R) h. M) _* i
"std" => "",
1 m2 w# `8 G8 `4 S9 k3 Y ),
: v# K6 n) M( o6 h9 t5 `0 ]4 u# a) @6 ^+ }+ _( j
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",: G, Z4 H$ M* e
"id" => $shortname."_sponsor_banner_two",
8 ~5 e2 ?9 t. u* D6 P6 M "type" => "textarea",) n e9 D9 U8 Y. D
"std" => "",
, L- P9 Y' k6 O ),* m) W+ S1 p/ s v5 X% L+ I, O
9 a0 {3 \! }- k1 |& f6 h( v6 M
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",5 {, Y) ^6 E5 Q) A! r# q
"id" => $shortname."_sponsor_banner_three",
2 D' ~! P4 o) U9 F4 y# k) {4 z& T- E "type" => "textarea",0 I& p. t! q: ^. q
"std" => "",4 `. O) L5 X$ B0 h1 ]! p; a+ d5 y `
),; K* v, a0 B% z/ W: n! E
W! f3 \$ ^/ V7 q
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",+ |6 H. v; {6 B
"id" => $shortname."_sponsor_banner_four",/ y/ A7 j) Y: {- K; ~6 [6 D& F
"type" => "textarea",. h- Z" P3 T* | [( |
"std" => "",
0 I0 E8 ~3 ~8 E$ f" g. \ ),) ~0 ^# s' ?: N0 d# z$ n3 y" r
. [ i* N ?+ d0 x9 C& C( M" t
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",$ N g9 O0 r- M$ X! k6 W* u0 N
"id" => $shortname."_sponsor_banner_five",
' N5 R. p* `% e7 B$ W% p' N0 J "type" => "textarea",% b5 J: J& F7 U2 a" _
"std" => "",: v- O+ ^/ U/ e4 b
),7 m' q7 ^9 ?. C6 l$ n9 o: L6 n5 \
1 m$ N' ? z$ E* m" l
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
# v0 K+ ^2 n: q+ B( ]9 F, J "id" => $shortname."_sponsor_banner_six",( \& o7 q& c* o. t0 l# k
"type" => "textarea",
) @" @3 j8 T4 X( g x* p "std" => "",# t$ S2 F" o2 S% v ?
),
8 a1 t$ X [+ l" ?, H( A2 E3 R9 f: t; ?7 f' D Y
array( "name" => "</div></div>"," v* v6 f% L% L% i: p s
"type" => "close",! B+ W5 y0 W' d$ ~0 }0 h8 Q
),
: k1 I* V/ ?/ P" Y) e: E* k
# N2 Z; _1 W! Z) _0 l6 k+ \
; q3 o) P% x& g8 ]6 Z, ^4 S7 J3 O' W
);& u9 A) R, k: n" D7 p2 Z
9 U4 a/ Y; l7 w( j
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {! L, m/ s& @* z6 k4 M& [: S' |
+ b! d! o! f1 i) ]
echo "<div id=\"admin-options\"> ";( D+ U9 \$ j+ o
$ u) E' Y* h; I3 X% T$ B7 |* nglobal $themename, $shortname, $options;
6 [ d/ f9 X* V4 U1 E: Wif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
% w) e% i' J3 sif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
1 X! n2 ?( } }& E0 S% f?>& K/ E; W9 t$ h* D# ~1 u9 r2 d$ V2 }% u
% U0 V$ j2 E1 X) X! t
<h4><?php echo "$themename"; ?> Theme Options</h4>9 X3 _- y: e' L( e$ X! I2 O
# F# k6 Z6 q4 o& t/ I& P
<div class="annouce">
0 c! O# W1 ]$ ?, {" Q<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
3 b9 F# j" H: A& o<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>2 b$ H8 L- R* r7 L
</div>
6 k6 A' E+ E, A! X% Z% ^- v* M5 o, j3 h, [$ s" S. p' T
<form action="" method="post">2 o3 a6 r: q0 U7 F
7 J, O( A/ z: g& f4 w0 B2 \/ @
<?php foreach ($options as $value) { ?>
2 p( C: Y6 v& q7 H4 j' _
0 L3 J2 }+ m& V# }* F<?php switch ( $value['type'] ) { case 'heading': ?>* R2 ?5 V T2 {' u7 N
# ]1 x2 D9 [$ F2 A C+ Z/ P9 ]<div class="get-option">
0 e n; V8 ^+ x: C J! N$ k- y4 x# U5 C6 F
<h2><?php echo $value['name']; ?></h2> I4 |! T1 g9 ]7 o0 E
, x2 |8 u0 ~! o2 G$ y3 g# p
<div class="option-save">. N- @) C7 I' F- d: e+ {: I
; g9 O" ]1 o9 G+ f
<?php
* V5 |2 I s# s Q3 [: lbreak;
# H, `) \* l+ }6 F$ b* x$ Qcase 'text':: \4 f; c+ v$ S1 B: p* h
?>
! v# H, M9 E( t3 A. i4 [ ~- d# K1 X
<div class="description"><?php echo $value['name']; ?></div>1 N) _ r+ k+ {: e7 m P
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
8 Z b- w N# F: a
$ U" r+ G, {+ s# ?get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
6 b/ D3 b, X) m, C, f/ M3 {6 u4 X, u: t# v* q
<?php
- Z; s+ w, _$ j2 F, wbreak;* ?, c9 r5 E# S2 i
case 'select':3 n* g- O E' f2 L) s/ `
?>0 d( {7 `* `3 R; X: }$ s8 s; M
5 [' g! q6 G& x# h9 R' u<div class="description"><?php echo $value['name']; ?></div>/ x. y+ g# k+ R! ]1 W
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
4 a7 K1 d% c! m<?php foreach ($value['options'] as $option) { ?>
; U1 V& w( w" n! Q& Z<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>" x' Y4 B2 h- M/ {) b
<?php } ?>* t% _' ]6 C; b
</select># S x- A7 M7 t8 G
</p>' Y2 g: R e& L/ Z" M- _+ L
" U; g" p/ E+ \& ]+ y
<?php$ S2 C" Q9 I! x! D( d* q/ ~
break;
) S, u% I' G; W5 O/ J" k; scase 'textarea':
& n5 o; p' I. E, A$ m" y- [9 ?$valuex = $value['id'];
1 O% N1 \0 X' C$valuey = stripslashes($valuex);
- Z( O! ]: }, a! }! C$video_code = get_settings($valuey);
. z# ?9 L8 w. l8 j- ??>6 F5 G" S4 J' ` t0 H u x- O
2 t: ^/ j& K" J+ ~! ]
<div class="description"><?php echo $value['name']; ?></div>* j7 s4 x+ ~2 j* i7 M9 X$ h2 {. [
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); } t4 B0 j/ ^. N( o' z
5 Q9 p) V. ^# L& Relse { echo $value['std']; } ?></textarea></p>
9 f7 H% Q' h; f# U* J/ d
2 n0 B$ [( n$ y& ]<?php
* U: @% _1 v! W0 g/ }5 U6 N% _break;
, m; y8 |6 U/ y; W6 t/ f. Fcase 'close':
2 A5 ?. L N2 f?>
7 u5 m- R7 m* a8 g1 i( | q) s5 i* w9 t" V \) o# p" D
<div class="clearfix"></div>3 \- B: l$ j- v$ l& D
</div><!-- OPTION SAVE END -->
7 j) `' e& \4 K' J0 V) I+ l) Y2 D v2 u# F. Z- Q) T" j/ o$ a" g! W
<div class="clearfix"></div>$ s* ]# k) I9 m" g- V. l4 R: e
</div><!-- GET OPTION END -->! O2 p- V, W [
! j0 c! Q3 }! k0 ~# l# Q" K
<?php' N) Z2 ]+ @% c6 _; ?0 ]3 w
break;
& [# T: a$ E2 K2 {/ W( Fdefault;" W7 n% k) T1 q' r- v
?>4 J) Y7 [" ]: ?, |; r
8 u& m# q; ^1 ?! S6 h# K
$ r- M9 m7 A: u% u
<?php
1 ^- S y8 a" l" ?/ L7 a% ]( B7 y3 Bbreak; } ?>
5 |: [! C4 u9 V
" j! u3 X7 c( ], f& \<?php } ?>
/ w7 j" h' `/ K
* b* r" K+ n1 Q7 L<p class="save-p">
V5 r, L% r7 l. q<input name="save" type="submit" class="sbutton" value="Save Options" />
6 @% o1 m* B) L3 D/ ^1 e<input type="hidden" name="action" value="save" />
8 P! Q4 I0 I# v. Q! X% p: t+ A</p>
4 W+ G5 P, A& r. _- A! a</form>* O( ]- N7 e* \
, v& n8 T0 g7 `: K% t; w
<form method="post">
& P& [# \4 m: h' E- k) Q8 b7 A) N<p class="save-p">) v- O+ N1 [$ c- Z+ {! f0 L
<input name="reset" type="submit" class="sbutton" value="Reset Options" />
~" n+ F/ C, {8 [8 ?5 A7 A2 g, H<input type="hidden" name="action" value="reset" />/ t C7 u. S' W
</p>
3 b4 y8 K v/ ?% L</form>
/ K4 ~0 ]6 |3 N8 f+ U0 O% H+ `, V7 G" Y
</div><!-- ADMIN OPTIONS END -->7 a- `, P% D1 X2 W$ X& |
- e% H2 W, y0 U" B<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }; L0 b9 g/ C$ \; I& p" D$ z
) y1 @, H3 A: D
function mytheme_admin_register() {+ }( K7 c8 N2 A* N* e. x1 B
global $themename, $shortname, $options;
) v& @- x8 q" k2 n4 Q) bif ( $_GET['page'] == basename(__FILE__) ) {
, B4 b9 R8 r7 a4 c" V5 ?0 Q7 Pif ( 'save' == $_REQUEST['action'] ) {( m$ c% L0 Z8 M0 }7 B
foreach ($options as $value) {1 n* L3 T# M$ t4 X* Q3 u
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }8 |/ t$ h9 K0 r
foreach ($options as $value) {
, G) p) X, i% G y% f7 J8 Oif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }* z2 A6 F# K- `
header("Location: themes.php?page=functions.php&saved=true");& k% j/ ~' G$ Z% @
die;$ r0 i; O8 s7 d9 W
} else if( 'reset' == $_REQUEST['action'] ) {
/ v( s7 M5 k9 y2 W1 I$ K! eforeach ($options as $value) {+ N7 w- i3 R+ f' V2 V& L) m
delete_option( $value['id'] ); }
9 Y! Q3 A1 y9 j. U2 `header("Location: themes.php?page=functions.php&reset=true");
" J9 e. z+ b. _ S _( o2 E! T* p/ R/ i* Qdie;
0 h4 I% ~/ B, ?; m g}' w5 l* f5 W5 {4 _9 Q8 |
}
( R/ \" T; _. I* ?add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
" ~7 {* {( W( r/ M7 \1 ^# I}0 z5 u j) k: _( L/ r
U; W' o/ u3 u$ j
function mytheme_admin_head() { ?>7 `8 Z& \3 p5 B- L
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
% g9 F b/ G, z0 r<?php }6 Y. c- v5 C$ \2 T e2 Q
|
|