|
|

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