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