|
|

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