|
|

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