|
|

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