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