|
|

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