|
|

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