|
|

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