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