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