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