|
|

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